How can i Execute program in C /C++ | i do i run a c program

By | July 22, 2015

execute program in c .learn about the step of execution in C++ program. A brief introduction of all step between execution and  compilation of C++ program.

here we learn how the C++ program is executed. How we can edit or create a new window in turbo C++? How we save our program and its compilation and execution? How we debugging our program in compilation and many more as you want in brief…….

In this class i will tell you about the execution of simple program in C++ and it steps briefly.

Asslam-o-alikum:

So let we start our topic:-

First of all i will tell you the steps of writing , compiling , or executing a program. The steps are as follow:

  •      Create and Edit a C++ Program
  •      Saving a C++ Program
  •      Compiling a C++ Program
  •      linking and loading a C++ program
  •      Executing a C++ Program.

These are the steps of Execution. Now i will define these step one by  one briefly for you:)

Create and Edit a C++ Program:)

In this step the programer can edit a new window and our code. the programmer user this step also in the middle stage of a program when own found any error in the program. This step is so easy because every person use Ms Word and note pad in which own has write some data and also perform some operations like cut,copy,paste ……execute program in c.

we will add up a new window in Turbo C++ like that……

execute program in c[howpk.com]

execute program in c[howpk.com]

Saving a C++ Program:)

This step is very important step because if we can’t save our program and our program have some logical and run type error and after Running the program our commuter screen will be still due to logical or run type error we will loss our code. That’s why we have to save our program before running the code. For the purpose we will F2 as a short cut key and FILE>SAVE in Mane bar.

Compiling a C++ Program:)

                     This the most important step as in previous tutorials i will tell you about the source code and object code.

that why you are easily understand this step “In this step the source code file can be converted into object code file”. Its means that in this step one more file is to created. Now we have to files first is user file which extension is .cpp and other object file which extension is .obj .

Compiler is used in this step and For this purpose  ALT+F9 as a short cut key and Compile>Compile used in the Mane bar.

linking and loading a C++ program:)

                      In this step the source code linked with header files and create a new file name as executable file. In this  step the header files and library files link with source to fulfill the user requirements. And here created a new file and its extension is .exe .

Note:)

There is no created a new file as executable file if there is any bug or any error in the source code. If the source code is Error free then the compiler linked the source code to header file and create a new executable file such like that…….

images[howpk.com

images[howpk.com

oooohhh We forget some thing loading

which is very simple after linking the code is loaded in the RAM is called loading.

Executing a C++ Program:)

This the last and final step because when our program is Error free and linking and loading process is complete then the programmer user that to show program output. For this purpose the programmer use Run<Run in mane bar and Crlt+F9 as a short cut.

Note:)

If we not compile our program by using above process this step is automatically perform these step like compiling linking and loading.

It is enough for today  i hope today class is helpful to you.keep watching our site for more update and not forgot to register on our site for subscription.

any question then make a comment on us.  Thanks…

Author: Awais Shafique

Hello My name is Awias.I am Student of BSCS in GCUF. I am the Senior Contributor of this website.