#include const int SIZE = 5; struct tester { int array[SIZE]; enum { SIZE = 3 }; void size() { std::cout << sizeof(array) / sizeof(int); } }; int main(int argc, char** argv) { tester t; t.size(); return 0; }
A
Correct answer
Explanation
The array member of the struct is declared using the global constant SIZE which equals 5. Inside the member function size, sizeof(array) evaluates to 5 times the size of an integer, and dividing by sizeof(int) yields 5. The inner enum declaration defining SIZE as 3 hides the global constant in some contexts, but does not affect the array size determined at class scope definition.