Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How execute a file .exe in my project?

Status
Not open for further replies.

Br0wser

Programmer
Nov 20, 2008
3
ES
How can i execute a file .exe in my program file? Is there a call system for this?

Thanks you.
 
Look at faq101-1951, faq101-1952, faq101-1953, and faq101-1954.


James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
To execute a system command or a program you can use the function system() from stdlib.
Here is an example how to execute a "Hello World" program:
Code:
/* system example : running a program */
#include <stdio.h>
#include <stdlib.h>

int main ()
{
  int i;
  // Executing program
  i=system ("hello_c.exe");
  printf ("\nReturned Value = %d\n",i);
  return 0;
}
Output:
Code:
Hello World from C !
Returned Value = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top