Creating a Console Application with Borland
C++ 5.02
To create a text, or console program (text-based), perform the following
steps:
Note: The name of your project, will normally become the name of your EXE
file.
Create a new source module for the project (Note: By default, you will already have an empty .c file in your project. This is where you will place your main function. You may not need to do this if you only need one source module.
+- You will want to organize
your files in a logical fashion. For example, create a C:\SCHOOL\C2 directory
for projects in your C Part 2 class. Then, make a directory here to hold
each assignment. The full path might be C:\SCHOOL\C2\HW1\HW1.IDE for Homework
1.
*- If the Project
window is not displayed, click the View menu choice, then the Project
sub-menu.
To Compile
Either click the Make Project
button on the toolbar (4th from the left), or select the Project
menu item, and then the Make All sub-menu.
To Run
Click the lightning bolt button
on the toolbar. Note that a console application, run from the environment
might not pause when the program terminates. You can add a call to getchar()
at the end of main() to make it pause, but when run from the command prompt,
this is not desirable.
You can also create a DOS prompt window, from the Start / Programs
/ Command Prompt selections (in Win95, not Borland C++). Then, change
to the directory where your project was created, and run the EXE file found
there.