1.3 Turbo C++

C Language Tutorials 

 Turbo C++

Compiler used for C language is called Turbo C++

- Provides a complete Integrated Development Environment (IDE) known as TC editor
- Used to create, edit, save , compile and run C programs
- Provides a powerful debugger feature → detecting and removing errors in programs
- Type TC on DOS prompt and press Enter key to Start IDE
- The menu bar of IDE contains menus to create, edit, compile, execute and debug C program
- The user can open menu by clicking it with the mouse.
- The user can also press a combination of ALT key and the first highlighted character of the name of menu.


For example:

               ALT+F is used to open File menu



Create, Edit, Compile, link & Execute Program



Creating and Editing a C program

  • Process of Writing C program is known as Editing
  • This process includes writing, modifying and deleting program statements
  • Part of Turbo C++ IDE that is used to write C programs is called Edit Window
  • A new edit windows can be opened by selecting File>New option from menu bar
  • Edit has a double lined border
  • Cursor blinks in the window
  • Position of the cursor indicates the starting point to write a program
  • User can expand window by clicking the arrow in the upper right corner

 

Saving a C program

  • Process of storing the program on disk
  • A program should be saved on disk to be used repeatedly
  • C programs are saved with .C extension

 

Procedure to Save a C program Using Turbo C++

  • Select File>Save. The Save As dialog box will appear
  • Default name NONAME00.CPP appears
  • Enter the file name
  • Enter the path to save file
  • Click OK. The program will be saved at specified location


Compile a C program

  • Process of converting source program into object program
  • Converted program save with .obj extension
  • Source program cannot be compiled if it contains any syntax error
  • Compiler generates error message to describe the cause of error


Procedure to Compile C program Using Turbo C++

  • Select Compile>Compile
  • Program will be translated into object program
  • In case of error, compiler will generate error message





Linking a C program

  • Linking is process of linking library files with object program
  • These files are used to perform different tasks such as input/output
  • A library file must be linked with the object file before execution
  • Linker is a program that combines the object program with additional library files
  • 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
  • The linker can be started in Turbo C++ by selecting Compiler > Link from the menu bar

 

Executing a C Program

  • Execution is the process of running an executable file
  • The C program can be executed afer compiling and linking
  • The program must be loaded into memory to execute
  • In Turbo C++,
  • The program can be loaded in the memory by selecting Run > Run from menu bar or pressing CTRL+F9.
  • The screen flickers for some time when a program is executed.
  • The output screen displays the output of the program and disappears.
  • The user can display the output screen by selecting Window > User Screen or pressing ALT+F5







Post a Comment

0 Comments

Close Menu