• C

program.c to .bat, possible? how?

Hello,

not sure if possible or not... but i need to be able to run a C program on Windows without compiling/building it.  How can this be done?  .bat, .exe, if so how..?

C program consist of only one file,, i.e. test.c

Thanks

abbas486Asked:
Who is Participating?
 
jhshuklaCommented:
console application? two ways to solve the problem: open command window, navigate to the folder & run it from there. other is to add system("pause") before exiting. the prog will wait until user presses a key.
0
 
PaulCaswellCommented:
Hi abbas486,

You could probably find a C interpreter but I doubt that is what you are looking for. Could you give us a little more on why you want to do this? We may be able tom come up with some alternatives.

Paul
0
 
abbas486Author Commented:
hi,

i need this because i may need to run this on a computer (Windows) which may not have a C compiler.  Therefore i was wondering if there is any way i can precompile and package it, and just simply run the program by doubleclicking on it ('it' being an icon of some sort).

Thanks
0
Managing Security Policy in a Changing Environment

The enterprise network environment is evolving rapidly as companies extend their physical data centers to embrace cloud computing and software-defined networking. This new reality means that the challenge of managing the security policy is much more dynamic and complex.

 
jhshuklaCommented:
sure. just compile the program and copy the executable (.exe) wherever you want. will work only on windows though. for linux and unix you wil need either (1) a cross compiler OR (2) a compiler on the target machine. but i suspect that you need it only for another windows machine.
btw which compiler are you using? do you know where the compiled file is saved?
0
 
PaulCaswellCommented:
You compile the .c program into an .EXE. That then runs on the computer as a program. It doesnt need a compiler to run.

Paul
0
 
abbas486Author Commented:
I am using MS Visual C++ 6.0.  The .exe in the debug folder works to a certain degree.  When I input the last data to the program, the program shuts down without proving the chance to see the tabulated results.
0
 
abbas486Author Commented:
thanks it works, now who gets the points hmmm...ill get back to this later
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.