Pointers: viva questions and MCQs
Computer Programming Lab (C), Unit 10. 100+ Pointers questions with explanations (Computer Programming Lab (C)). Topics: C Pointers, C Pointers Output. Take a free test now.
Topics
- C Pointers: pointer, address, memory, malloc, array element, allocates, causes, declares
- C Pointers Output: holds address, holds sizeof, double pointer, sizeof double, printf, prints
Key terms: pointer, address, memory, malloc, array element, allocates, holds address, holds sizeof, double pointer, sizeof double, printf, prints
Sample questions with answers
In C pointers, "Array of pointers" means:
Options: A) Pointer that points to nothing, value 0 B) Array whose elements are addresses, e.g. char *names[5] C) Allocated memory that is never freed D) Allocates a block of memory on the heap and returns its address
Answer: B) Array whose elements are addresses, e.g. char *names[5]. Array of pointers: Array whose elements are addresses, e.g. char *names[5].
Pointer to an array element can move to the next element using:
Options: A) p-- B) *p++ only C) &p D) p++
Answer: D) p++. Increment.
Pointer to a character is used to handle:
Options: A) Files only B) Unions only C) Strings D) Only integers
Answer: C) Strings. char *.