Your Virtual Knowledge Campus

Learn object oriented programming ,at

object oriented programming languagesObject oriented programming languages or Learning object oriented programming language is an important subject to the present world.Because most of the software application are developed with the help of oop or c++.

Who Developed C++?

Bjarne Stroustrup is Normally considered as  the father of C++.He started developing it in 1979 at Bell Labs as an enhancement to the C programming language and originally named it “C with Classes”. It was renamed..

to C++ or oop  in 1983.

Though Without the C programming language , there would be no C++. So indirectly, Dennis Ritchie & Brian Kernighan (Developers of C in 1972, also at Bell Labs) are considered as the father  of the language as well.

Setting up a compiler — Very first work:

For using any programming language, setting up a compiler is first work. Compiler is that by which a written programming code turns into executable that a computer can run and show us the output.

There are many compilers for C++Code blocks (, an open source compiler, may be a suitable chooses among them. It can run under Windows, Linux as well as Mac.

Starting with  C ++:

Basic Format of  c++ program.

main() —  ——– >Main  Function  of  a c++ program
{                          >Start of program here
—————         >Program statement here

}                          > End of program

Example of C++  Programming:

C++ program consists of some block of code. The important block is “main()” function block. It is a must for every code written in C++.The other functions are controlled from this function.

A basic C++ program is like this:

#include <iostream>// Header file for cout ,cin etc
using namespace std;
int main(){
cout << "Welcome to C++ tutorials" << endl;// used for Display prompt.
return 0;

or A basic C++ program is like this:

#include <iostream.h>// Header file for cout ,cin etc.

int main()
cout << "Welcome to C++ tutorials" << endl;// used for Display prompt.
return 0;

Note: if we use #include<iostream.h>

then there is no need of “using namespace std;”

Description of the above c++ program code:

1. The program is started by “#include”, a processor directive which is used to tell compiler to put code from header to program before executing the code.A header is used to access various functions of C++.

2. The header “iostream.h” contains the information of cin() and cout() function.

3.Then  main() function is used. Every function in C++ starts and ends with two curly braces ( {…} ). Not only functions but also any block of C++ start and end with curly braces. The curly braces hold our written code in main function.

4. Before main()  function a word “int” is used which tells us this function is returning a integer value (it is illustrated in functions section of this site).

5. The cout() (cout means console output) function in curly braces is used to print something.After executing this program, “Welcome to C++ tutorial” will be seen in display.

6.Using namespace std Here , std means “standard”

7. endl means “end of line” used for new line.

8. For  any input  cin>>variable this line is used in c++.

9. For any output or display anything  cout<<” some thing here”<< variable which you want to display<< endl; is used in c++.

10. One of the important parts of C++ built in function is semicolon (;) which is used at the end of the function. If semicolon is not used, an error will be shown in the display.

11. Next command of the program is return 0 (illustrated in function section). This means that the main function does not return any value.

Finally compile the code using compile button to check error. Then using the compiler’s build button, make the program executable and then run it.

The output of above two code is:

Well come to C++tutorials.

Related Post or you may like: © 2017