[Solved] Printing contents of a vector [duplicate]
[ad_1] As you mentioned “I did not understand what the code is doing”, let me briefly describe how to iterate through a container: The long way: vector<int> result = { 1,2,3 }; for (vector<int>::iterator it = result.begin(); it != result.end() ; it++) { int i = *it; cout << i << ” “; } Each … Read more