Say SomeStruct
is defined as:
struct SomeStruct {
int member;
};
What does these means?
&SomeStruct::member
int SomeStruct::*
I encounter this, tried to output its type info but still cannot figure out the meaning. Below is a working example:
#include <iostream>
#include <typeinfo>
using namespace std;
struct SomeStruct {
int member;
};
int main(int argc, const char *argv[])
{
cout << typeid(&SomeStruct::member).name() << endl;
cout << typeid(int SomeStruct::*).name() << endl;
return 0;
}
Compiled by i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
on my MBP, the output is:
M10SomeStructi
M10SomeStructi