#include<iostream>
using namespace std;
class Stu
{
int a,b;
public:
void show()
{
int a,b;
a=10;
b=15;
cout<<"Object address is "<<this<<endl;
cout<<"A :"<<this->a<<endl;
cout<<"B: "<<this->b<<endl;
}
};
int main()
{
Stu s;
s.show();
return 0;
}
标签:
this-pointer
0条回答
相关问题
- Assigning C++ function pointers to member function
- Can you explain the concept of the this pointer? [
- copy constructor of a class which has self-pointer
- Replacing std::function from within itself (by mov
- How to get this pointer from std::function?
相关文章
- Can you explain the concept of the this pointer? [
- copy constructor of a class which has self-pointer
- Replacing std::function from within itself (by mov
- How to get this pointer from std::function?
- 为什么上下文在这两个事件处理程序不同(Why is context different in the
- C++ Assigning this pointer of a class to either a
- Address of pointer “this” changed unexpectedly ins
- 凡被存储在计算机内存中的“这个”指针?(Where is the 'this' po