[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
TurboCppHelloWorld

Turbo C++ Hello World program

General Information

The Turbo C++ IDE (aka Turbo C++ 3.0) is a developer environment created by Borland Corp in 1992 to enable programmers to write C/C++ programs. Turbo C++ (version 3.0) first came as an MS-DOS compiler, supporting C++ templates, object oriented programming, generation of DOS & protected mode executables, as well as generation of code targeting specific legacy CPUs, such as Intel 80186.

Working in Turbo C++ 3.0

The main aim behind this section is to give you an idea about how to use the Turbo C++ IDE for creating a simple program, (a "Hello World" program)

Configuring the Turbo C++ IDE

Before you start with writing programs you have to tell the IDE where the following files are located:

  1. the include Directories ( or header files) - files that contain your standard include files (usually files that end with .h)
  2. the library directories - Turbo C++ startup object files and run-time library files (.lib files)
  3. the output directories - to store your .obj, .exe, and .map files
You could just about give any path as long as the include directories contain header files and the library directories contain library files. However for relative convenience, there should be folders like INCLUDE, BIN, LIB, etc which readily come as part of the package.

Click on Directories from the Options menu. If you have installed Turbo C++ in C:\TC specify the following:

  • "C:\TC\INCLUDE" - for Include Directories box
  • "C:\TC\LIB" - for the Library Directories box
  • "C:\TC\BIN" - for the Output Directory
Default output directory is TC\BIN but you might want to set this to another directory to prevent the TC executables from getting mixed up with your own programs. Also set the working/default directory by selecting File -> Change Dir.

Save your settings by selecting Options -> Save.

This should get you started with woking in the IDE.

Making the program

Once you have started the application, you might see an empty workspace. To start a new program click on File|New. You will have a default empty file named NONAME00.CPP loaded. Type the following lines of code:
//Hello.cpp
//Written in Turbo C++ compiler version 3.0
  1. include<iostream.h>
int main() { cout<<"Hello World"; }
Now you need to compile the program. It is a good practice to save the file before you compile it or run it. Either press F2 to save or click on the Save option from the file menu and simply specify a name for your file. (Here it is saved as hello.cpp). Press Alt+F9 to compile or select Compile from the Compile menu. If there were errors in your program it will immediately display the number of errors in the next window. If there were no errors then your program has compiled successfully. Sometimes the compilation may not come as clean as you think. If you are using Turbo C++ for the first time you have to configure your IDE; provide realtive paths to libraries, or header files, etc.

If you have come clean, you are good to run the program. To run the program press Ctrl+F9 or click on Run from the Run menu.

You should get the output as shown below:
Hello World


'Hello World' links



last edited (December 30, 2006) by bilderbikkel, Number of views: 5997, Current Rev: 4 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.