M
miaohua1982
the code is as follows:
#include<iostream>
using namespace std;
class A
{
public:
int a;
int b;
};
int main(int argc,char **argv)
{
int (A::*pInt) = &A::a;
if ( &A::a )
{
cout<<"OK1n"<<endl;
}
if( pInt)
{
cout<<"OK2"<<endl;
}
return 0;
}
I run the code in VC7 , VC8
the problem is why there is only out put "OK2"?
#include<iostream>
using namespace std;
class A
{
public:
int a;
int b;
};
int main(int argc,char **argv)
{
int (A::*pInt) = &A::a;
if ( &A::a )
{
cout<<"OK1n"<<endl;
}
if( pInt)
{
cout<<"OK2"<<endl;
}
return 0;
}
I run the code in VC7 , VC8
the problem is why there is only out put "OK2"?