Networking, Programming and Graphics Tutorials

This pointer - C++ [1/1]

Type:
This pointer - C++
Level: Expert Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials 
This pointer - C++
Date: 2006-Dec-12
This pointer - C++
Visited: 2193 times
This pointer - C++
Rating: This pointer - C++
This pointer - C++
Author: Alex Plumpton

C++ uses the keyword this to point to the object, which invokes the member function. For instance, if class emp has a member function called getdata and the object objl of emp invokes it as shown in the first statement. The second statement will return the object objl, which invoked the function. We assign value to the data members of the class inside the member function using the general form as shown.

obj1.getdata(); 
return(
this);


<
data _member>=<value> <=> this-><data_member>=<value>

Rate this tutorial:                    
Networking, Programming and Graphics Tutorials - This pointer - C++ [1/1] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: +pointer +"c++"  c++ use of "this pointer"  pointer c++ & *  this pointer in C++  c++ this pointer  this pointer in c++  -> * pointer C++  pointer-to-members c++  What are pointer-to-members in C++?  returning * this pointer + c++  assigning to this pointer c++  C++ pointer-to-members  c++ object pointer example  C++ * pointer examples  MANIPULATION OF FILE POINTER  making 3D anything  instant messangers  how to burn iso with nero  Online Home Network Diagnostics  C++ encapsulation