In C++, this pointer is passed as a hidden argument to all non-static member function calls. The type of this depends upon function declaration. If the member function of a class X is declared const, the type of this is const X* (see code 1 below), if the member function is declared volatile, the type of this is volatile X* (see code 2 below), and if the member function is declared const volatile, the type of this is const volatile X* (see code 3 below).
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- 'this' pointer in C++
- Opaque Pointer
- Pointer to an Array | Array Pointer
- A C/C++ Pointer Puzzle
- Passing Reference to a Pointer in C++
- Sum of array using pointer arithmetic
- Multidimensional Pointer Arithmetic in C/C++
- How to declare a pointer to a function?
- When do we pass arguments by reference or pointer?
- Reference to a pointer in C++ with examples and applications
- Common Memory/Pointer Related bug in C Programs
- Trie Data Structure using smart pointer and OOP in C++
- C++ Program to count Vowels in a string using Pointer
- Scope Resolution Operator Versus this pointer in C++?
- Declare a C/C++ function returning pointer to array of integer pointers