Having x variable defined in global and local scopes, what value of y will be displayed at the end of the program?
const int x = 5;
int main(int argc, char** argv)
    int x[x];

    int y = sizeof(x) / sizeof(int);

    return 0;
The local name will hide the global after the end of the declaration, so the local variable x does not hide the global x until the end of the declaration.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes