Introduction Part
Basically C++ is an object oriented evaluation of C.
The very basic programming concepts of C and C++ are same.
The two beautiful computer programming language share same data types,flow controls etc.
C++ was developed by Bjarne Stroustrup at AT&T Bell Labotories in early 1980's.
The most important features that were added to C++ are classes,inheritance,function,overloading,and operator overloading.These features make the C++ object-oriented programming language.
Application Of C++
C++ is featured with versatility and so you can do alot with this language.This language is suitable for any programming task including development for editors,compilers,databases,communication systems and any complex real-life application system.
As C++ is combination of C(close to machine language) and object-oriented programming so we can use it for both kind of programmings.
A Simple C++ Program
Now Lets start a simple C++ program.This program will print a string on the screen.
#include<iostream> //include header file
using namespace std;
int main()
{
cout<< "C++ is welcoming you,Lets start programming"; //This is c++ statement
return 0;
} //End of program
Lets talk about Program Features
Just like C,C++ also has a main() method,where execution begins.C++ statements also ends with semicolons(;) as shown in the program.The comment line start with double slash(//),if you are using a single line of comment,for multiple line of comments,you have to open your comments with slash star(/*) and close the comments with star slash(*/).
The only statement used in the above program is an output statement.The statement
cout <<"C++ is welcoming you,Lets start programming";
prints the string in quotation(" ") mark on the screen. This single statement uses two c++ features,cout and <<. The identifier cout is a predefined object that represents the standard output stream in c++.The operator << is called the insertion or put to operator.It inserts the contents of the variables on its right to the object on its left.
We have used the following include directive in our above program:
#include<iostream>
This directive contains the declarations for the identifier cout and the operator <<.
Now Lets talk about namespace, this is a new concept introduced by the ANSI C++ standard committee.This defines the scope for the identifier used in the program.For using the identifiers defined in the namespace scope we must include using directive,like we did in our above program.Here,std is the namespace wher ANSI C++ standard class libraries are defined.
In C++,main() method is integer type so we have to use a return statement which will return integer value.As we did in our above program.
return 0;
The very basic structure of all C++ Progarm
//Here define preprocessors,you need to include for your program.for example
#include<iostream>
using namespace std; //compulsory declarartion
int main() //execution begins here
{
// here goes your codes
return 0; //finally return statement
}
Basically C++ is an object oriented evaluation of C.
The very basic programming concepts of C and C++ are same.
The two beautiful computer programming language share same data types,flow controls etc.
C++ was developed by Bjarne Stroustrup at AT&T Bell Labotories in early 1980's.
The most important features that were added to C++ are classes,inheritance,function,overloading,and operator overloading.These features make the C++ object-oriented programming language.
Application Of C++
C++ is featured with versatility and so you can do alot with this language.This language is suitable for any programming task including development for editors,compilers,databases,communication systems and any complex real-life application system.
As C++ is combination of C(close to machine language) and object-oriented programming so we can use it for both kind of programmings.
A Simple C++ Program
Now Lets start a simple C++ program.This program will print a string on the screen.
#include<iostream> //include header file
using namespace std;
int main()
{
cout<< "C++ is welcoming you,Lets start programming"; //This is c++ statement
return 0;
} //End of program
Lets talk about Program Features
Just like C,C++ also has a main() method,where execution begins.C++ statements also ends with semicolons(;) as shown in the program.The comment line start with double slash(//),if you are using a single line of comment,for multiple line of comments,you have to open your comments with slash star(/*) and close the comments with star slash(*/).
The only statement used in the above program is an output statement.The statement
cout <<"C++ is welcoming you,Lets start programming";
prints the string in quotation(" ") mark on the screen. This single statement uses two c++ features,cout and <<. The identifier cout is a predefined object that represents the standard output stream in c++.The operator << is called the insertion or put to operator.It inserts the contents of the variables on its right to the object on its left.
We have used the following include directive in our above program:
#include<iostream>
This directive contains the declarations for the identifier cout and the operator <<.
Now Lets talk about namespace, this is a new concept introduced by the ANSI C++ standard committee.This defines the scope for the identifier used in the program.For using the identifiers defined in the namespace scope we must include using directive,like we did in our above program.Here,std is the namespace wher ANSI C++ standard class libraries are defined.
In C++,main() method is integer type so we have to use a return statement which will return integer value.As we did in our above program.
return 0;
The very basic structure of all C++ Progarm
//Here define preprocessors,you need to include for your program.for example
#include<iostream>
using namespace std; //compulsory declarartion
int main() //execution begins here
{
// here goes your codes
return 0; //finally return statement
}