Tuesday, November 12, 2013

Starting turbo C/C++


Opening Turbo C/C++ Editor: If your computer has Windows, you can adopt the following methods to open your Turbo C IDE (Integrated Development Environment.  An IDE normally consists of a source code editor, build automation tools and a debugger.). Actual it is not Turbo C IDE; it is Turbo C++ IDE Version 3.0. But using this editor we can create C++ as well as C programs. If you want to create C programs then simply save your file with extension .C  (E.g. Myfile.c) and for C++ programs save your file with extension .cpp (E.g. Myfile.cpp).

Using windows XP

Step 1: Click on the start button.

Step 2: Click on All programs and then click on Accessories menu and then select Command Prompt. Your screen will look like as follows (yours may be different).

C:\Documents and Settings\Krish>

Where Krish is the user name of my computer. You will see another user name defined by you in your system. At the command prompt type CD\ and press Enter Key. And follow the procedure below:

Common procedure :
If TC is the directory where your TC compiler is placed, then type the following commands at the C prompt.

C:\>CD TC <Enter>
C:\TC>TC <Enter>

If your TC compiler is located at another directory, then specify that directory name.
E.g. C:\>CD  <DirName> <Enter>
C:\DirName>TC <Enter>

If your TC compiler is located at another drive and directory, then after C:\> appears do the following:
C:\>DRIVELETTER : <Enter>
E.g. C:\>D: <Enter>
D:\> CD  <DirName> <Enter>
D:\DirName>TC <Enter>


Your Screen will look like as follows:


Note: We write TC at the command prompt because when we write TC at the command prompt, it means we are going to run one of the following files:

TC.COM
TC.EXE
TC.BAT

So, we can only execute these three executable files using command prompt. Files having the extension .COM, .EXE and .BAT. You can specify the full filename like TC.EXE at the command prompt, but there is no need to write this. As in Turbo C directory there is only one executable file having primary name TC (i.e. TC.EXE). 

So when we need to write full file name at the command prompt?
Consider that these all three files (i.e. TC.COM, TC.EXE and TC.BAT ) are available in the same directory, then it is mandatory to specify the full name of the file (e.g. TC.EXE) at the command prompt to start Turbo C. What will happen when we simply write TC and the command prompt ? 

In such case the OS will execute TC.COM file. As their order of execution is as follows:

.COM                    First priority
.EXE                     Second priority and
.BAT                     Third priority

Remember that our Turbo C compiler executable file is TC.EXE.

No comments:

Post a Comment