Install Turbo C and C++

Turbo C++

Turbo C++ is an integrated development environment (IDE) to write C++ programs. It is the implementation of Borland International it is used to create, edit and save C++ programs. It also provides a powerful debugger. The debugger helps the users in detecting and removing errors in C++ programs.

Install Turbo C and C++

Installing Turbo C++

There are different types of installers available for Turbo C++ such as Turbo C++ 30 The installation of Turbo C++ is very simple. The user can follow a simple wizard for installing Turbo C++. The wizard prompts the user to specify the root folder. The default folder is TC. The user can simply copy the folder and paste it on hard disk. The installation of Turbo C++ creates TC folder on hard disk. 

Press this butt0n to install  Turbo C / C++

The TC folder has the following subfolders:

INCLUDE

It contains the header files.

LIB

It contains the library files.

BIN

It contains the source files and executable files.


Initializing Turbo C++ IDE

The following procedure is used to initialize Turbo C++ IDE

  • Go to BIN folder in TC folder
  • Double-click on TC.EXE file. The Turbo C++ will start

The words Turbo C++ IDE appear at the top of the window. IDE stands for integrated development environment.

It displays the menu bar that includes the following menus.

File

It contains the commands for the following:

  • Creating new files
  • Opening existing files
  • Printing source code
  • Exiting Turbo C++ IDE

Edit

It contains the command for the following:

  • Copying the code
  • Pasting the code
  • Undo and Redo

Search

It contains the commands for the following:

  • Find
  • Replace
  • Go to a specific line number etc

Run

It contains commands for running C++ programs.

Compile

It contains commands for compiling C++ programs. It contains commands for debugging C++ programs

Debug

It contains commands for working with C++ projects

Project

It contains commands for setting directories and configuring IDE environment.

Options

It contains commands for managing different windows in Turbo C++ IDE.

Windows

It contains commands for getting help about Turbo C++ IDE The user can press.

Help

F1 to display help.

The menu bar can be activated by pressing F10. The user can then select any menu by pressing the arrow keys to right or left side. A menu can also be activated with a combination of Alt key and first letter of any menu For example, the user can press Alt+F to activate File menu as follows:

Setting up Directories

IT Series Object-Oriented Programming using C++

By default, Turbo C++ stores object files and executable files in BIN subdirectory of TC directory. It is not the right place for storing these files. These files should be stored in the same directory in which source files are stored. The user can change the setting for output and source directories.

Setting up Directories

The following procedure is used to set the output and source directories

Select Options > Directories

  • A window will appear with four fields.

Include Directories: 

It indicates the location of standard header files included in C++ programs. It should already be set to drive\TC\INCLUDE. The drive can be any drive on computer Library Directories. It indicates the location of library files. It should already be set to drive:\TC\LIB. The drive can be any drive on the computer.

Output Directories: 

It indicates the location where the compiler stores object files and linker stores executable files.

Source Directories: 

It indicates the location of source code of the libraries that do not belong to the open project.

  • Enter the path for output directory like "C\MyPrograma in Output Directory field. 
  • Enter the path for Source directory like "C\MyPrograms in Output Directory field 
  • Click OK. The new setting will be applied.

The above setting indicates that Turbo C++ in installed on C drive and the name of the folder is TC. These setting can be different if the user has copied or installed C++ on different drive or with different name.

Creating and Editing a C++ Program

The process of writing C++ program is known as editing. This process includes writing, modifying and deleting program statements. The edit window in Turbo C++ IDE is used to write C++ programs. A new edit window can be opened by selecting File > New option from menu bar.

Creating and Editing a C++ Program

The edit window has a double-lined border. The cursor blinks in the window. The position of the cursor indicates the starting point to write a program. The user can expand the window by clicking the arrow in the upper right corner. The user can also select Window > Zoom to expand the window. The vertical and horizontal scrollbars are used to navigate through the program.

Saving a C++ Program

The process of storing the program on disk is known as saving. A program should be saved on disk to be used repeatedly C++ programs are saved with epp extension. For example, a program can be saved like program.cpp

The following procedure is used to save a C++ program:

  • Select File > Save OR press F2 key The Save File As dialog box will appear.
  • Enter the file name. The default name NONAME00 CPP appears in the dialog box.
  • Enter the path to save file. The default location to save programs is BIN directory. 
  • Click OK. The program will be saved at specified location with specified name.

Compiling a C++ Program

The process of converting source program into object program is known as compiling. The program saved with.cpp extension contains the statements of C++ language. It is known as source program. The source program cannot be executed by computer directly. A compiler converts the source program into object program and saves it in a separate file. The object program is saved with object extension.

Turbo C++

The source code cannot be compiled if it contains any syntax error. The compiler generates error message to describe the cause of error. All errors must be removed to successfully compile a source program.

The following procedure is used to compile a C++ program:

  • Select Compile > Compile OR press ALT+F9 key. The program will be translated into object program if it contains no error. The compiler will generate error message if the program contains any error.

Linking a C++ Program

IT Series Object-Oriented Programming using C++:

The process of linking library files with object program is known as linking. These files are used to accomplish different tasks such as input/output etc. A library file must be linked with the object file before execution of program. A program that combines the object program with additional library files is known as linker. It is part of C++ compiler.

The linker generates error message if the library file does not exist. A new file is created with exe extension if the process of linking is successful. This file is known as executable file and can be executed by the computer directly The linker can be invoked in Turbo C++ by selecting Compiler > Link from the menu bar.

Executing a C++ Program

The process of running an executable file is known as executing. A C++ program can be executed after compiling and linking. It must be loaded into the memory to execute. A program that places an executable file in the memory is known as loader. The program can be loaded in the memory by selecting Run > Run from menu bar or pressing CTRL+F9.

The screen flickers for a moment when a program is executed. The output screen displays the output of the program and disappears. The user can see the output screen by selecting Window > User Screen or pressing ALT+F5.

Executing a C++ Program

Post a Comment

0 Comments