Question 16
What does the declaration 'extern int arr[16];' inside a function indicate?
Detailed Solution
'extern' provides a reference to a global symbol defined elsewhere; it does not allocate memory.
What does the declaration 'extern int arr[16];' inside a function indicate?
'extern' provides a reference to a global symbol defined elsewhere; it does not allocate memory.
What is the effect of declaring a function parameter as 'register int count' in C?
The 'register' keyword can be applied to function parameters as a compiler hint for register allocation.
Which memory segment stores uninitialized global and static variables in C?
Uninitialized static and global variables are stored in the BSS (Block Started by Symbol) segment and zero-filled before execution.
What is the scope and linkage of a top-level global variable declared as 'static int var = 19;' in a C source file?
The 'static' specifier at file scope restricts visibility to internal linkage, making the variable accessible only within the declaring translation unit.
What is the output of the following C code?
#include <stdio.h>
int x = 20;
int main(void) {
int x = 30;
{
int x = 40;
printf("%d ", x);
}
printf("%d", x);
return 0;
}Inner block scope declarations shadow outer scope declarations of the same identifier name.