Describe "this" pointer?, C/C++ Programming

It is a pointer accessible only in the member functions of a struct, class or union type. It points to the object for which the member function is called. Static member functions do not have this pointer. While a nonstatic member function is called for an object, the address of the object is passed out as a hidden argument to the function. For instance, the following function call

myDate.setMonth( 3 );

may be interpreted this way:

setMonth( &myDate, 3 );

The object's address is accessible from in the member function as the pointer. This is legal, by unnecessary, to use this pointer while referring to members of the class.

 

Posted Date: 3/16/2013 2:58:28 AM | Location : United States







Related Discussions:- Describe "this" pointer?, Assignment Help, Ask Question on Describe "this" pointer?, Get Answer, Expert's Help, Describe "this" pointer? Discussions

Write discussion on Describe "this" pointer?
Your posts are moderated
Related Questions
A: this is a procedure during exception handling while the destructor is called for all local objects in the stack among the place where the exception was thrown & where this is ca

how to pass array

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

3. Write a program to encrypt and decrypt strings of characters using the following ciphers: a) Caesar cipher b) Vigenere cipher c) Matrix transposition cipher Your program shoul

C++ Multiplayer Game Programming Project Project Description: We are seeking an experienced C++ Game Programmer to enhance clientside related aspects of MCS: Mars City Securi

write a program that adds all numbers from 1 to 200

Project Description: 1) Develop banking software 2) Payment Gateway System There is some other system available for development. I'm willing to show long-term opportunity

if age of ram,shayam and ajay are input through keyboard,write a program to determine the youngest of the three.

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve betw

What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than a