随笔-145  评论-173  文章-70  trackbacks-0

#include <iostream>
using namespace std;

class A
{
public:
       int a;
       A(int x):a(x){}     
};

int main()
{
    A a(5);
    int A::*p = &A::a;
 int A::**pst = &p; 
    cout << a.*p << endl;
 cout << a.**pst << endl;
 cout << *(a.*pst) << endl;  //error
    getchar();
    return 0;
}

posted on 2010-01-11 15:00 deercoder 阅读(155) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理