“type”: 非法的 sizeof 操作数
sizeof 运算符需要表达式或类型名称。
以下示例生成 C2070:
// C2070.cpp
void func() {}
int main() {
int a;
a = sizeof(func); // C2070
}
可能的解决方法:
// C2070b.cpp
void func() {}
int main() {
int a;
a = sizeof(a);
}
“type”: 非法的 sizeof 操作数
sizeof 运算符需要表达式或类型名称。
以下示例生成 C2070:
// C2070.cpp
void func() {}
int main() {
int a;
a = sizeof(func); // C2070
}
可能的解决方法:
// C2070b.cpp
void func() {}
int main() {
int a;
a = sizeof(a);
}