• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

Introduction

C++

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.

Features of C++

  • C++ is an object oriented programming language (OOPL).
  • It can be used for developing System Software, operating systems (OS), compilers, editors and data bases.
  • C++ have huge Function Library.
  • It is highly Flexible language with Versatility.
  • C++ is suitable for Development of reusable software, thus it reduces cost of software development.
  • It is a Machine Independent Language.

Structure of C++ program

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;
												-----------------;
												-----------------;
											}
											
										

Difference between C and C++

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:-

  • C programming is procedure oriented programming (POP) and C++ is an object oriented programming (OOP).
  • C programming is top to bottom programming approach,but C++ is bottom to top programming approach.
  • C++ has inheritance concept but C has not inheritance concept.
  • C programming is structured design, but C++ is object oriented design.
  • C programming input/output is based on library and the processes are carried out by including functions, but C++ I/O is made through console commands cin and cout.