I have a class and a vector of elements of that class. I need to insert new objects in a specific position of my vector, but I can't even access the positions that I want. I tried to print my iterator but it's not working... I tested iterators with a vector of ints and it's working okay, I just can't make it work with my own class... What am I missing?
ToDo individualTask;
vector<ToDo> myToDoList;
vector<ToDo>::iterator it;
myToDoList.push_back(individualTask);
cout << myToDoList.size() << endl;
myToDoList.resize(10);
for (it = myToDoList.begin(); it != myToDoList.end(); ++it) {
cout << *it << endl; // not working
}
I tried *it->toString() and it says that my class doesn't have the method toString