c++ – Difference between begin and cbegin

Question:

What is the difference between begin and cbegin , end and cend , etc.?

Answer:

Methods prefixed c return constant iterators . It means that

  • You cannot change values ​​through them.
  • They can also be used with constant objects.
Scroll to Top