Introduction of c++-: C + + is an object oriented programming language it was developed by Bjarne Stroustrup at AT & T Bell Laboratories in Murray Hill ,New Jersey ,USA ,in the early 1980s . Stroustrup,an admiral of simula67 and strong supporter of C, Wanted to combine the best of both the language and create a more powerful language that could support object oriented programming features and still retain the power and Elegance of C. The result was C + +. Therefore C + + is an extension of C with a major edition of the class construct feature of Simula 67 since the class was a major addition to original C language. Stroustrup initially called the new new language C with classes . However, letter in 1983, the name was changed to C + +. The idea of C++ comes from the C increment operator + +, thereby suggesting that C + + is an augmented (incremented) version of c. More click here
Operator In C++-: C++ also support a rich set of built in operator we have already used several of them such as equal to add(+)Minus(-) multiplication(*) and division(/) operator is a symbol that tells the computer to perform certain mathematics or logical manipulation. operators are used in program to manipulate data and variables. they usually form a part of mathematical or logical expression.
Function in c++ programming -: We know that function play an important role in C program development. Dividing a program into function is one of the major principle of top down structured programming. Other advantage of function is that it is possible to reduce the size of a program by calling and using them at different place in the program.
Class In C++ programming -:A class is a way to bind the data and its associated function together. It allows the data to be hidden. If necessary from external use. When defining a class we are creating a new abstract data type that we can be treated like any other built in data type. Normally class has two types.
- Class Declaration -:The class declaration describe the type and the scope of its member
- Class Function Definition -:The class function definition describe how the class function are implemented.
Constructors In C++ Programming –: In c++ programming language A constructors is a special member function whose task is to initialize the object of its class. It is a special because its name is the same as the class name. The constructors is involved whenever an object of its associated class is created. It is called constructors because it construct the values of data member of the class.
Destructors In C++ -: C++ also provide another member function called the destructors that destroyed object when they are no longer required.
It is the name implies . It is used to destroy the object that have been created by a constructors. Like the constructors is a member function whose name is the same as the class name but is preceded by a tilde.
Inheritance in C++ -: Inheritance is the process by which object one class acquire the properties of object of another class. Inheritance support the concept of hierarchical classification. For example the bird ‘robin’ is the part of the class ” flying bird” which is again a part of the class “bird”. The principle behind this sort of division is divided class shares common characteristic with the class from which is derived as illustrated.
We know that a pointer is a derived data type that refers to another data variable by storing the variable memory address rather than data. a pointer variable define where to get the value of a specific data variable instead of defining actual data
Polymorphism in c++-: Polymorphism is one of the crucial features of OOP. It simply means ‘one name, multiple form’. Polymorphism is a Greek word it means ” ability to take more than one ” An operation may exhibit difference behavior in different instance. The behavior depends upon the types of data used in the operation. For example adding two number the operation will generate a sum. if the operands are string then the operation would produce a third string by concatenation. the process making an operator to exhibit difference behaviors in different instance is known as operator overloading.
C++ Streams -: The i/o system design to work with a wide variety of device including terminals disks and tape drives. Although each device is very different the i/o system supply and interface to the programmer that is independent to the actual device being accessed. this process called the stream .
Template in c++ -: Template is one of the features added to c++. It is a new concept which enable us to define generic classes, functions and thus provides support for generic programming.
Generic programming is an approach where generic types are used as parameters in algorithm so that they work for a variety of suitable data type and structures. A template can be used to create a family of classes or function . Like a class template for an array class would enable us to create array of various data type such as int array and float array.