Hi guys,
I've never used this function before, and have a need for it today. I'm getting a lovely bunch of compiler errors...I swear I'm sending in the iterators that it wants.
This program is simply a test for me to figure out this function, and make sure I can use it with vectors. I can handle it with simply arrays of simply data types, but things are a little harry now. Any advice?
Code:#include<iostream> #include<algorithm> #include<vector> #include"computer.h" using namespace std; int main() { vector<Computer> computers; Computer comp; for (int i = 0; i < 4; i++) { comp.setLetter(i + 97); computers.push_back(comp); } while (next_permutation(computers.begin(), computers.end())) // Problems here? { for (int i = 0; i < 4; i++) { cout << computers[i].getLetter(); } cout << endl; } return 0; }