Let’s say I go through the line through the cycle with iterators. How do I disable a string symbol corresponding to this cycle iteration? STD :: COUT & LT; & LT; STR [i] & lt; & lt; “\ n”; does not work.
Code:
for (auto i = str.begin (); i! = str.end (); i ++) {
// Here it is necessary to display the symbol in this iteration of the cycle
}
Answer 1, Authority 100%
for (auto i = str.begin (); i! = str.end (); i ++) {
COUT & LT; & LT; * i;
}
That’s all 🙂 The iterator is an analogue of a pointer, which, when specifying with *
, gives what indicates.