Correct: Pointer that points to 0
A null pointer points to address 0 and is used to indicate that the pointer is not assigned any valid memory.
Correct: '++i' increments before use; 'i++' increments after use
'++i' increments the value before it's used, 'i++' increments after the current expression is evaluated.
Correct: Variable retains value between function calls
Static variables keep their value between multiple function calls and have internal linkage if declared globally.
Correct: Depends on compiler and architecture
The size of 'int' depends on the system and compiler, usually 4 bytes on modern systems but not guaranteed.
Correct: malloc() allocates memory without initialization; calloc() initializes memory to zero
malloc() allocates uninitialized memory, whereas calloc() allocates and initializes memory to zero.
Correct: 5
a++ returns the current value (5) and then increments a.
Correct: Pointers pointing to freed memory
Dangling pointers point to memory that has been freed/deallocated and accessing them causes undefined behavior.
Correct: Structure allocates separate memory for each member; union shares memory for all members
Structures allocate memory for each member separately, whereas union members share the same memory location.
Correct: Tells compiler variable may change unexpectedly
'volatile' tells the compiler not to optimize the variable as its value may be changed outside program flow (e.g., hardware).
Correct: Undefined behavior, because local variable goes out of scope
Local variables are destroyed when function ends, returning their address causes undefined behavior.