How can I create a c++ program using DOS

Asked By 30 points N/A Posted on -
qa-featured

How can I create a program using DOS command prompt and how can I run and save the file?

Can you show me the procedures on how to do this?

SHARE
Best Answer by Head Jonathon
Answered By 0 points N/A #103523

How can I create a c++ program using DOS

qa-featured

 

Simple to create C programs using dos. 
 
C program do not need a defined editor.
You can use edit <filename> to create a file and save it with an extension *.C. Than You need the C compiler installed in your computer. The C compiler has a executable file called tcc.exe.  Go to the directory where C is installed and type 
tcc <filename.c>
The compiler compiles and creates the output file named filename.exe. You can run it at the prompt by typing filename.exe.
 
Another syntax is
tcc  -o <execfilename.exe> <sourcefilename.c>
 You get the output file in execfilenmame.exe.
 
Another way is by
tcc -run sourcefile.c
 
for which the program runs automatically.
 
Thanks.
 
Best Answer
Best Answer
Answered By 0 points N/A #103524

How can I create a c++ program using DOS

qa-featured

Hi Elizabeth,

In order to make the program start by making a DOS executable. A DOS executable is a program that is run through command window. These files can have extensions like.exe, .com, .bat or .cmd .vbs or .vbe.

In DOS and Windows, batch files are executed by the command interpreter. Note that
the command cannot contain spaces.

Open a notepad (or any other text editor) file and type your code in it.

Save the notepad file with a name say “program.exe” where .exe is extension for executable files.

Type the name of the executable file in the MS-DOS prompt and press Run. It will run the program and shows the output.

Hope this help!

Related Questions