VKV SirTest Lab

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

Key terms: pointer, address, memory, malloc, array element, allocates, holds address, holds sizeof, double pointer, sizeof double, printf, prints

Sample questions with answers

  1. 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].

  2. 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.

  3. Pointer to a character is used to handle:

    Options: A) Files only   B) Unions only   C) Strings   D) Only integers

    Answer: C) Strings. char *.

Take a free Pointers test

All units of Computer Programming Lab (C)