• 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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
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?
Need More Insight Into What’s Killing Your Network

Flow data analysis from SolarWinds NetFlow Traffic Analyzer (NTA), along with Network Performance Monitor (NPM), can give you deeper visibility into your network’s traffic.

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
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.
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
abbas486Author Commented:
thanks it works, now who gets the points hmmm...ill get back to this later
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.