Multiple choice

Which of the following is a true statement about pointers?

  1. Pointer arithmetic is permitted on pointers of any type.

  2. A pointer of type void * can be used to directly examine or modify an object of any type.

  3. Standard C mandates a minimum of four levels of indirection accessible through a pointer.

  4. A C program knows the types of its pointers and indirectly referenced data items at runtime.

  5. Pointers may be used to simulate call-by-reference.

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

A: False - void* pointers don't allow arithmetic. B: False - void* must be cast to dereference. C: False - C standard doesn't mandate minimum indirection levels. D: False - C has no runtime type checking. E: True - passing pointers lets functions modify original data, simulating call-by-reference.