IT WORLD

Welcome To The World Of IT

Thursday, April 7, 2016

this pointer in C++

C++ uses a unique keyword called this to represent an object that invokes a member function. this pointer in C++ is a pointer that points to the object for which this function was called. For example, the function call: 1 A.max() will set the pointer this to the address of the object A. The starting address is the same as the address of the first variable in the class structure. This unique pointer is automatically passed to a member function when it is called. The pointer this acts as...

Understanding the program in C++

In this article we will understand the program written in C++ programming language in step-by-step manner. Consider the below simple C++ program that performs multiplication of two integers and displays the result. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 /*Program that performs multiplication of two integers and displays the result*/   //Include header files #include <iostream> #include "conio.h" using namespace std;   //main program starts from here void...