Open MonsieurNeko opened 3 years ago
In the last for loop, the loop variable has semantically no reason to be a string::size_type as we iterate a vector and not a string.
string::size_type
It would be better to write, for consistency with examples from the book, something like this:
for (decltype(vec.size()) i = 0; i != vec.size(); ++i) { if (i != 0 && i % 8 == 0) cout << endl; cout << vec[i] << " "; }
In the last for loop, the loop variable has semantically no reason to be a
string::size_type
as we iterate a vector and not a string.It would be better to write, for consistency with examples from the book, something like this: