chellappa said:
Hello,
I would like to know how i can execute an exe file using c prgogram? I
am using the GNU GCC in Linux Could someone explain me how to do that ?
send mail chellappa at gmail .com
Even though it is considered a poor idea, and sometimes considered rude,
to ask for e-mail responses, I am e-mailing this as well as posting it.
There are several reasons that you don't want responses by e-mail, but
the most important is that you have no way of judging the answers you
get. When an answer is posted to the newsgroup, it is subject to the
scrutiny of other posters and so can be corrected when wrong,
incomplete, or misleading.
The simple answer to your question is to use system(). It is documented
both in the docs for your implementation and in even the most basic C
text.
There are other approaches that are specific to certain platforms or
implementations. Among the more used are the exec*() family which is
POSIX and the spawn*() family which is not. Neither of these is
necessarily present in a C implementation, since they are non-standard.
That makes them off-topic in <so if you choose to
use them questions belong in newsgroups specific to your platform or C
implementation.
That is often considered rude, since it presumes relationships of
expectation and obligation.
But that's nice.