If the class name is x, what is the type of its "this" pointer (in a nonstatic, nonconst member function)
Answers
Answered by
8
In class name x, x* is the type of its this pointer.
Explanation:
- 'this' pointer points to the address of the current object of the class.
- In other words, 'this' pointer is used with an object so that it can access its self-address.
- So, we see this pointer in member functions of a class as an implicit parameter.
- If the member function is declared constant, then the pointer will be const x *.
- 'this' pointer is not available for the static member functions, as they don't need an object to invoke them.
Learn more:
1. Ch+=2 is equivalent to
brainly.in/question/21331324
2. A CSS file cannot be linked to a web page. State True or False.
brainly.in/question/21107345
Similar questions