By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

exicut_file_in_c

P: n/a
hi friends,
Can any one tell me how to execute an executable file
like test.exe by c programme.
-aakash

Sep 14 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
skyspy said:
hi friends,
Can any one tell me how to execute an executable file
like test.exe by c programme.
See "The C Programming Language", 2nd edition, by Kernighan and Ritchie,
page 167, or "C - A Reference Manual", 4th edition, by Harbison and Steele,
page 407.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 14 '06 #2

P: n/a
"skyspy" <sk*******@gmail.comwrote:
Can any one tell me how to execute an executable file
like test.exe by c programme.
RTFFAQ: <http://c-faq.com/osdep/system.html>.

HTH; HAND.

Richard
Sep 14 '06 #3

P: n/a
skyspy wrote:
Can any one tell me how to execute an executable file
like test.exe by c programme.
#include <stdlib.h>

int main(void)
{
system("test");
return 0;
}
August
Sep 14 '06 #4

P: n/a
August Karlstrom said:
skyspy wrote:
>Can any one tell me how to execute an executable file
like test.exe by c programme.

#include <stdlib.h>

int main(void)
{
system("test");
On some systems, that will fail, even if test.exe is available for such use,
because "test" is not necessarily a synonym for "test.exe".

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 14 '06 #5

P: n/a
In article <NL********************@bt.com>,
Richard Heathfield <in*****@invalid.invalidwrote:
>August Karlstrom said:
>skyspy wrote:
>>Can any one tell me how to execute an executable file
like test.exe by c programme.

#include <stdlib.h>

int main(void)
{
system("test");

On some systems, that will fail, even if test.exe is available for such use,
because "test" is not necessarily a synonym for "test.exe".
Yes, and on some systems, it will fail because you run out of disk space
while trying to compile it.

Thus showing the idiocy of this "It must be guaranteed to run
everywhere, everytime, or else it is crap" mentality.

Sep 14 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.