4/30/2017

Programming Language: Program Execution

 

When we are writing any program we have three choices

1.Programming Language

2.Scripting

3.Markup Language

Programming Language :

We consider that the example below is for C/C++

We have some basic steps :

1.Write a program

2.Compile it via compiler.

3.Link the program

4.run it

 

We can write the program in any editor even in Notepad++.

Visual Studio is a IDE (Integrated Development Environment) from Microsoft which is able to combined all the above steps.

when we write a program like this

//file: test.cpp

#include <iostream>

using namespace std:

int main(){

cout<<”Hello this is first output”<<endl;

 

 

 

Visual Studio is used to write the above C++ program .

After writing the program , it is being compiled.

Once the program is compiled(compiler) , its create object file similar to test.obj

after that compilation , test.obj is linked with C++ library(Linker perform this ) and executable file is produced.

it will be named like test.exe (In Linux environment it will be test.o)

 

.exe is a special file type in windows , which denote to a program executable.

Once the file is clicked , Operating system gives control to this program .

First line from where the program start is main() ….

all the subsequent line is executed one by one , once it reach to return 0;

or any return int ; on the last statement of program ,

program return the control to Operating system .

 

Visual studio or any other compiler (like GCC ,DevC++)can be used to compile and run the program .