🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Iterators in C++: all 10 questions

Quiz: Iterators in C++ · Question 8 of 10

What kind of iterator do cbegin() and cend() return?

What kind of iterator do cbegin() and cend() return?

  1. A.Reverse iterators
  2. B.Const iterators, which allow reading but not modifying elements
  3. C.Random iterators that skip elements
  4. D.Iterators that copy the container
Answer & explanation

Correct answer: Const iterators, which allow reading but not modifying elements

Assigning through a const iterator is a compile error, which protects read-only loops.

Can you get the rest right without peeking?

Take the timed Quiz: Iterators in C++ quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →