is it possible to run a C program from batch file.

S

sjayaramit

hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c
 
C

Cinder6

hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c

You would want to compile the program first, but after that, yes, you
can run any program you write with a batch file. Otherwise, you would
be limited to displaying the source code or manipulating the file in
some way (you could use a batch file to compile it, though).
 
P

pankaj

hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c

what is your problem???
Do you want to run *.c program(silly) or the o/p of *.c program means
*.exe file.

In batch file you can execute almost any executable file.

Regards,
Pankaj Maheshwari
 
M

Mark McIntyre

hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c

Thats not a C programme, thats the source code for a programme.
Compile/link it into an executable and you can run it however you want
to.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
P

pete

Mark said:
On 23 Oct 2006 22:56:57 -0700, in comp.lang.c , (e-mail address removed)
wrote:
Thats not a C programme, thats the source code for a programme.

The source code for a C program, is what a C program is.

N869
5.1.1.1 Program structure
[#1] A C program need not all be translated at the same
time. The text of the program is kept in units called
source files, (or preprocessing files) in this International
Standard.
 
S

Simon Biber

hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c

C:\>type devc++\programs\examples\myprogram\one.c
#include <stdio.h>

int main(void)
{
printf("This is one.c\n");
return 0;
}

C:\>copy con one.bat
@echo off
c:\Dev-Cpp\bin\gcc.exe devc++/programs/examples/myprogram/one.c
a.exe
del a.exe
^Z
1 file(s) copied.

C:\>one
This is one.c
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top