Help Document to Use Turbo C++ Editor
Help Document to Use Turbo C++ Editor
The Development Environment - Integrated Development Environment (IDE): The Turbo C compiler
has its own built-in text editor. The files you create with text editor are called source files, and for C++
they typically are named with the extension .CPP, .CP, or .C.
The C Developing Environment, also called as Programmer‟s Platform, is a screen display with
windows and pull-down menus. The program listing, error messages and other information are
displayed in separate windows. The menus may be used to invoke all the operations necessary to
develop the program, including editing, compiling, linking, and debugging and program execution.
To invoke the IDE from the windows you need to double click the TC icon in the directory c:\tc\bin.
The alternate approach is that we can make a shortcut of tc.exe on the desktop. This makes you enter the
IDE interface, which initially displays only a menu bar at the top of the screen and a status line
below will appear. The menu bar displays the menu names and the status line tells what various
function keys will do.
Default Directory
Using Menus
If the menu bar is inactive, it may be invoked by pressing the [F10] function key. To select
different menu, move the highlight left or right with cursor (arrow) keys. You can also revoke
the selection by pressing the key combination for the specific menu.
To type a program, you need to open an Edit Window. For this, open file menu and click “new”. A
window will appear on the screen where the program may be typed.
1
Writing a Program
When the Edit window is active, the program may be typed. Use the certain key combinations to
Saving a Program
To save the program, select save command from the file menu. This function can also be performed
by pressing the [F2] button. A dialog box will appear asking for the path and name
of the file. Provide an appropriate and unique file name. You can save the program after compiling too
The source file is required to be turned into an executable file. This is called “Making” of the .exe file.
The steps required to create an executable file are:
2. Compile the source code into a file with the .obj extension.
3. Link your .obj file with any needed libraries to produce an executable program.
All the above steps can be done by using Run option from the menu bar or using key combination
Although the source code in your file is somewhat cryptic, and anyone who doesn't know C will struggle
to understand what it is for, it is still in what we call human-readable form. But, for the computer to
understand this source code, it must be converted into machine-readable form. This is done by using a
compiler. Hence, compiling is the process in which source code is translated into machine
understandable language.
It can be done by selecting Compile option from menu bar or using key combination Alt+F9.
2
Creating an Executable File with the Linker
After your source code is compiled, an object file is produced. This file is often named with the
extension
.OBJ. This is still not an executable program, however. To turn this into an executable program, you
must run your linker. C programs are typically created by linking together one or more OBJ files with
one or more libraries. A library is a collection of linkable files that were supplied with your compiler.
In the Turbo C IDE, compiling and linking can be performed together in one step. There are two ways to
do this: you can select Make EXE from the compile menu, or you can press the [F9] key.
Executing a Program
If the program is compiled and linked without errors, the program is executed by selecting Run from the
If every program worked the first time you tried it that would be the complete development cycle: Write
the program, compile the source code, link the program, and run it.
Unfortunately, almost every program, no matter how trivial, can and will have errors, or bugs, in the
program. Some bugs will cause the compile to fail, some will cause the link to fail, and some will only
Whatever type of bug you find, you must fix it, and that involves editing your source code, recompiling
Correcting Errors
If the compiler recognizes some error, it will let you know through the Compiler window. You‟ll see
that the number of errors is not listed as 0, and the word “Error” appears instead of the word “Success”
at the bottom of the window. The errors are to be removed by returning to the edit window. Usually
these errors are a result of a typing mistake. The compiler will not only tell you what you did wrong;
they‟ll point you to the exact place in your code where you made the mistake.
3
Exiting IDE
An Edit window may be closed in a number of different ways. You can click on the small square in the
upper left corner, you can select close from the window menu, or you can press the [Alt][F3]
[Alt][X] Combination.