Category Archives: c++ programming language

C language: a brief description

introduction to c: C programming is a high-level programming language where Instructions consist of algebraic expressions, English keywords such as if, else, for, do, while etc. In C programming, program can be divided down into several small modules. Hence, it can be also called a structured programming language. C programming is flexible to use as system programming as well as… Read More »

Type conversion in C++

Type Conversion: In computer science, type conversion refers to changing an entity of one data type into another kind of data type. There are many ways for type conversion in c++ such as conversion from basic to class type, conversion from class to basic type and conversion from class to another class type. We know… Read More »

Operator overloading using friend function in c++

Operator overloading: Operator overloading is the strength for a language to re-define the way of operators to behave for specific objects. Overloading operator supports the programmer to extend the language and provides new abilities. We can almost create our own language by the creative use of the function and operator overloading techniques. The way of… Read More »

Unary and binary operator overloading in c++

Operator overloading: Operator overloading is the strength for a language to re-define the way of operators to behave for specific objects. Overloading operator supports the programmer to extend the language and provides new abilities. We can almost create our own language by the creative use of the function and operator overloading techniques. The way of providing special meanings… Read More »

‘This’ pointer in c++

‘This’ Pointer   The member functions of every object have access to a sort of magic pointer named as this pointer, which points to the object itself. Thus any member function can find out the address of the object of which it is a member. Every member function of a class is born with the… Read More »

Friend function in c++

Friend Function:   According to the OOP language, private members cannot be accessed from outside the class. i.e. a non-member function can’t have any access to the private data of the class If there is a situation where two classes need to share a particular function then what to do? C++ allows the common function… Read More »

Constructor and destructor in c++

Constructor:  A constructor is a ‘special’ member function of a class whose task is to initialize the object. It is immediately invoked when an object of its related class is created. The constructor is written using the class name as a function and the initialization of variables is done within braces. Sometimes it is necessary… Read More »

Destructor in c++ example and program

Destructor: Destructor is the special type of member function which is executed automatically when the object is destroyed. It is the inverse of the constructor function. The most common use of destructors is to deallocate memory that was allocated for the objects by the constructor. A destructor is called automatically when that object passes out… Read More »

Constructor in c++: types and sample program

Constructor:  A constructor is a ‘special’ member function of a class whose task is to initialize the object. The constructor is immediately invoked when an object of its related class is created. It is written using the class name as a function and the initialization of variables is done within braces. Sometimes it is necessary… Read More »