C/c
Expert: Joydeep Bhattacharya - 2/23/2007
Questionsir how would we run the exe file
-------------------------------------------
The text above is a follow-up to ...
-----Question-----
sir i just to know how would i create an exe file in c
-----Answer-----
Hi Shweta
When ever you are writing a C/C++ program the exe and obj gets created automatically try looking inside your folder where you have the source codes.
In case if you don't find it please get back to me and inform me what compiler you are using ...
regards
Joydeep Bhattacharya
AnswerHi Shweta
You can run an exe file using a C program also here is the program to do so ... This is mainly developed by one of my friend and I have done a little modification in it you can try out this website
http://www.scodz.com where you can find solutions to many problems like this
//Source Code
#include <stdio.h>
#include <process.h>
int main(int argc, char *argv[])
{
int loop;
char name[100];
clrscr();
printf("Enter program to run\n");
/* Get the path of the file to run */
gets(name);
strcpy(argv[0],name);
if (argc == 1)
{ /* check for only one command-line parameter */
printf("%s calling itself again...\n", argv[0]);
execl(argv[0], argv[0], "ONE", "TWO", "THREE", NULL);
perror("EXEC:");
exit(1);
}
printf("%s called with arguments:\n", argv[0]);
getch(); getch();
for (loop = 1; loop <= argc; loop++)
puts(argv[loop]); /* Display all command-line parameters */
return 0;
}
If you still have any doubt please get back to me for any clarification
regards
Joydeep Bhattacharya