Question 71
Which of the following operators introduce a sequence point in C?
Detailed Solution
Logical AND (&&), Logical OR (||), Comma operator (,), and Conditional operator (?:) introduce sequence points. Bitwise AND (&) does NOT.
Which of the following operators introduce a sequence point in C?
Logical AND (&&), Logical OR (||), Comma operator (,), and Conditional operator (?:) introduce sequence points. Bitwise AND (&) does NOT.
Which of the following storage classes have static storage duration (lifetime throughout program execution)?
Static local variables, global variables, and extern variables all persist in memory throughout program execution. 'auto' local variables exist only during block execution.
Which of the following statements regarding pointers and arrays in C are CORRECT?
Array names decay to pointers and arr[i] == *(arr + i). sizeof(arr) returns total bytes. However, array names are constant pointers (non-modifiable lvalues) and CANNOT be reassigned.
Which of the following dynamic memory allocation functions are declared in <stdlib.h>?
All four functions—malloc, calloc, realloc, and free—are standard dynamic memory management routines in <stdlib.h>.
Which of the following cause Undefined Behavior in C?
Dereferencing NULL, writing to read-only string literals, and reading uninitialized garbage auto variables invoke undefined behavior.