我有一个简单的结构,我想要一个指向成员 c 的指针。我正在使用 MSVC2012,如果我不将 struct abc 声明为类型定义(typedef),我就不能使用它.. 怎么会?
struct abc
{
int a;
int b;
char c;
};
char (struct abc)::*ptt1 = &(struct abc)::c; // Error: error C2144: syntax error : 'abc' should be preceded by ')'
typedef struct abc;
char abc::*ptt1 = &abc::c; // Compiles just fine