Pointers in C

This quiz contains various questions related to pointer in C language which will test your understanding of the topic.

Last Updated :
Discuss
Comments

Question 1

What is a pointer in C?


  • A variable that stores the address of another variable

  • A variable that stores data directly

  • A keyword to create arrays

  • None of the above

Question 2

Which symbol is used to declare a pointer?

  • &

  • *

  • #

  • %

Question 3

What is the output of the & operator?

  • Value at address

  • Value of variable

  • Address of variable

  • None

Question 4

What is the default value of an uninitialized local pointer?

  • 0

  • NULL

  • Garbage Value

  • -1

Question 5

Which format specifier is used to print an address in C?

  • %c

  • %d

  • %p

  • %s

Question 6

What does the following pointer declaration mean?

C
int *p;


  • p is an integer

  • p is a pointer to an integer

  • p is an address

  • p is an function

Question 7

What will *(&x) return?


  • Address of x

  • Value of x

  • Error

  • Address of pointer

Question 8

Which of these is NOT a valid way to assign NULL to a pointer?

  • p = NULL;

  • p = '\0';

  • p = 0;

  • p = "NULL";

Question 9

What is a dangling pointer?


  • pointer that points to valid memory

  • pointer that points to NULL

  • pointer that points to freed memory

  • pointer that is initialized

Question 10

Which of the following is true about pointer arithmetic?

  • p++ increments the value stored

  • p++ moves to next memory block based on data type

  • p++ does nothing

  • p++ decreases the address

Tags:

There are 20 questions to complete.

Take a part in the ongoing discussion