共用方式為


編譯器錯誤 C2227

'->member' 的左邊必須指向 class/struct/union/generic 類型

備註

-> 左邊的運算元不是類別、結構或等位的指標。

Example

下列範例會產生 C2227:

// C2227.cpp
int *pInt;
struct S {
public:
    int member;
} s, *pS = &s;

int main() {
   pInt->member = 0;   // C2227 pInt points to an int
   pS->member = 0;   // OK
}