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.

  1. From the File menu choice, select New, and then Project.
  2. The New Target dialog will appear.
  3. In the Project Path and Name place the full path and file name for your desired project. +
  4. In Target Name, make sure the desired name of your EXE file is correct.
  5. In the Target Type, make sure that Application (EXE) is selected.
  6. In the Platform selection, make sure that Win32 is selected.
  7. In the Target Model, make sure that Console is selected.
  8. Make sure that nothing is checked in the Frameworks, Controls, and Libraries areas.
  9. Make sure that Static (not dynamic) is checked.
  10. Click the Advanced button.
  11. In the Advanced Options dialog that appears, make sure that .c node is the only item checked (remove the .rc and .def checks)
  12. Click OK in the Advanced Options dialog, brniging you back to the New Target dialog.
  13. Click OK in the New Target, and the dialog will be closed and the blank project created.

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.

  1. From the File menu, select New, and then Text File
  2. This creates a blank source code file, and automatically gives it a .cpp extension. Make sure you do a File/Save As to save it with the appropriate extension (.c, .h, etc)
  3. Make sure that the first line in the Project window, the EXE name, is highlighted. *
  4. Click the Add File To Project button on the toolbar, (3rd from right)
  5. Select the new file you did a file save as with in step 15.
  6. You should now see the file name appear in the Project window.

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