🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: C Pointers: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does this print? (code)
  2. Q2. For int a[] = {2, 4, 6, 8};, what is (a + 3)?
  3. Q3. If p is an int pointer holding address 1000 (int = 4 bytes), what address is p + 2?
  4. Q4. What does this print? (code)
  5. Q5. What happens when you dereference a NULL pointer?
  6. Q6. What does this print? (code)
  7. Q7. What does this print? (code)
  8. Q8. What does this print? (code)
  9. Q9. With const int p = &x;, what is allowed?
  10. Q10. Why must a void be cast to a typed pointer before you dereference it?