← 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?
- A.Reverse iterators
- B.Const iterators, which allow reading but not modifying elements
- C.Random iterators that skip elements
- 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 →