MCQ Single Best Answer Easy

QWhat is the difference between a const pointer and a pointer to a const in C?

ID: #7197 Pointer in C Language 192 views
Question Info
#7197Q ID
EasyDifficulty
Pointer in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A A const pointer cannot be dereferenced, while a pointer to a const can
  • B A const pointer cannot be reassigned to point to a different memory location, while a pointer to a const can
  • C A const pointer points to a const object, while a pointer to a const can point to a non-const object
  • D A const pointer and a pointer to a const are equivalent in C
Correct Answer: Option C

Explanation

Answer: C

Explanation: In C, a const pointer points to a const object, which means that the object it points to cannot be modified through the pointer. On the other hand, a pointer to a const can point to a non-const object, but it cannot be used to modify that object.

Share This Question

Challenge a friend or share with your study group.