C++ is an partial copy of object oriented programming languages (OOPL) and it consider to be an extension of C programming language. C++ was developed by Bjarne Stroustrup at AT & T Bell laboratories of USA in 1980. Initially, it was called C with classes as it has all properties of C programming language with an additional concept of classes. However, it was renamed to C++ in 1983. The name C++ is a combination of c programming language and the increment operator ("++"), indicating an increment at the development of C. C++ is also known as superset of C programming language. Almost all the concepts of C are applicable to C++ also.
The execution of every program begins with main function. This function may or may not take parameters, it always returns void. It indicates logical beginning of the program, other commands and constructs are enclosed with in braces as the body of main function.
Simple structure of C++ program:-
Include header file section
Include declaration section
Void main() {
Body of the main function;
}
Complete structure of C++ program:-
Include header file section
Include declaration section
Class Class_Name{
Private:
member variables;
member functions;
Public:
member variables;
member functions;
Protected:
member variables;
member functions;
}
Void main(){
Class_Name Object_Name
Body of the main function;
-----------------;
-----------------;
}
The C++ programming language is used for developing system applications on different platform such as Windows, UNIX, LINUX...etc. There are some examples of C being used as follows:-