← 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 →- Q1. What does this print? (code)
- Q2. For int a[] = {2, 4, 6, 8};, what is (a + 3)?
- Q3. If p is an int pointer holding address 1000 (int = 4 bytes), what address is p + 2?
- Q4. What does this print? (code)
- Q5. What happens when you dereference a NULL pointer?
- Q6. What does this print? (code)
- Q7. What does this print? (code)
- Q8. What does this print? (code)
- Q9. With const int p = &x;, what is allowed?
- Q10. Why must a void be cast to a typed pointer before you dereference it?