Coupon Accepted Successfully!


Typical C++ Environment (Borland C++)

In this section, brief information is given about the different platforms for C++ implementation, and execution of C++ programs using Borland C++ compiler under the Windows platform is described.

Step 1: Open Any Text Editor

Unix/Linux platform:

Use text editors such as Gedit, Kwrite, Medit, ed, VI, etc.

Windows platform:

Use text editors such as Notepad, Wordpad, etc.

Alternately, one can use integrated Borland C++ compiler, which supports its own text editor. Once Turbo C++ is installed, it automatically creates a directory turboc3 and subdirectory bin. Follow the path c:\turboc3 and click the executable file tc. One can use desktop shortcut for turboc3. Turbo C++ screen appears, which is blank initially and has a menu bar at the top, which is shown as follows.

Description: 104909.png

Step 2: Write The Code For The Program

Write the code to fulfill the requirements of the program, if possible using the proper syntax and indentation using an editor.

Alternatively, create a source program using integrated Turbo C++ editor. Go to the File menu and select New. The file name NONAME00.CPP appears on the screen at the centre of the window. Check whether your source program is typed correctly. If mistakes are found, correct them.

Step 3: Save The File With .CPP As An Extension

Description: 104923.png


Now press F2 to save your program or use Save option with .cpp extension. You can change the file name and save it using the Save option in File menu. In the following window the file is saved with ABC.CPP.

Step 4: Compile The Program

Unix/Linux platform:

Open the terminal window; change the working directory to the directory where the program file is stored.


Compile the program using the command: g++ filename.cpp


It will display the errors and warnings. If there are any errors and warnings, correct them and save the corrected file again.


After successful compilation, file a.out will be created in the same directory.

Windows platform:

Use IDE such as Turbo C++.


From the File menu, open the program file and compile it using ‘Compile’ option in Compile menu or use Alt+F 9.


It will display the errors and warnings. If there are any errors or warnings, correct them and save the corrected file again, compile again. If program is correct, then the window shows:

  • Warnings: 0
  • Errors: 0

After successful compilation, a file filename.obj will be created in the same directory. The following window shows the compilation of a program named ABC.CPP.

Description: 104931.png

Step 5: Run The Program

Unix/Linux platform:

Use command ./a.out to run the program.

Windows platform:

Use ‘Run’ option from Run menu of Turbo C++ IDE or use ctrl+F9 and see the output as per program.

The following window shows execution of ABC.CPP program.

Description: 104938.png

Test Your Skills Now!
Take a Quiz now
Reviewer Name