Thursday, July 30, 2009

How do u call one exe from another exe in C programming?

for example i want to open notepad.exe from my C program


I use turboc and dev C++

How do u call one exe from another exe in C programming?
int ret = system("notepad");





I've added the ret assignment because sometime programs may result in errors.





If ret==0 then no error.





For notepad you could just use





system("notepad");
Reply:use the system() function:





#include %26lt;stdlib.h%26gt;


int main()


{


system("program.exe");


}





but this does not return the control back.





if you want the control back then try the spawn functions from


process.h.


[I don't know whether this is standard function or not. I think you can verify it by yourself. :) ]


No comments:

Post a Comment