vector question
C / C++ / MFC
3
Posts
2
Posters
0
Views
1
Watching
-
Is there any easy way to shift or swap elements inside vector? For example if I have a vector that contains: A B C D E F and I want to swap elements B and C to read A C B D E F Thanks in advance! -Rob
Whoever said nothing is impossible never tried slamming a revolving door!
-
Is there any easy way to shift or swap elements inside vector? For example if I have a vector that contains: A B C D E F and I want to swap elements B and C to read A C B D E F Thanks in advance! -Rob
Whoever said nothing is impossible never tried slamming a revolving door!
std::swap(v[1], v[2]);
-
std::swap(v[1], v[2]);