Tuesday, April 30, 2013

HELLO WORLD IN "C++"



C++ is just super class c, all programs that run in a C compiler will run in C++ compiler but vice versa is not true.I personally felt C++ is more easy than C,there is no prior knowledge of C is necessary.But remember C is mother of all programming language ,so it is always a plus point .C++ is Object Oriented Language which make it easier to program.You design a class and create object of that class. A class contain variables and functions. Object contain the property of the class to which it belong.Here is the first program in C++.
Extension of a C program is c and of C++ program is .cpp.
Here is HELLOWORLD.CPP

#include<iostream.h>
#include<conio.h>
void main()
{
cout<<"hello world";
getch();
}

IOSTREAM.H is new header file introduced in C++ which contain object like COUT,CIN etc
COUT work similar to printf i.e to display characters on the screen. Rest of the code is same as C program.

No comments:

Post a Comment