Compiler Error C2070
'type': illegal sizeof operand
The sizeof operator requires an expression or type name.
The following sample generates C2070:
// C2070.cpp
void func() {}
int main() {
int a;
a = sizeof(func); // C2070
}
Possible resolution:
// C2070b.cpp
void func() {}
int main() {
int a;
a = sizeof(a);
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for