C/c

Advertisement


Question
sir 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

Answer
Hi 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

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Joydeep Bhattacharya

Expertise

Ability to solve C and Data Structure problems and puzzles with simple and easy to understand logic.

Experience

C, C++, Java, Data Structure, PHP, Web Designing

Organizations
http://www.scodz.com Designation: webmaster

Publications
http://www.scodz.com

Education/Credentials
Master of Computer Applications

Past/Present Clients
http://analysingc.50webs.com http://www.funforu.com

©2012 About.com, a part of The New York Times Company. All rights reserved.