Search code examples
csystem

How to run an executable file with c language?


I was trying to execute this program using C language compiler 3.0 every thing is going alright but when i run this program it never open firefox and when i run this program`s executable file it shows compatibility issue errors :( please help me

#include<stdlib.h>
#include<stdio.h>
int main(void)
{
 system("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
 return 0;
}

Solution

  • Take a look at the execve function : http://msdn.microsoft.com/en-us/library/hyw61wtd(v=vs.80).aspx