Vector Lists
HY ALL, I JUST COMPILED THIS CODE BUT IT WONT GIVE ME THE EXPECTED OUTPUT. Please help to debug. #include <iostream> #include <vector> #include <string> using namespace std; int main() { vector<string> stringList; vector<string>::iterator stringListIterator; for(stringListIterator = stringList.begin(); stringListIterator != stringList.end(); ++stringListIterator) { cout << "Enter a string" ; string stringName; cin >> stringName; stringList.push_back(stringName); if(stringList.size() == 10) { break; } } for(stringListIterator = stringList.begin(); stringListIterator != stringList.end(); ++stringListIterator) { cout << *stringListIterator; cout << endl; } return 0; }