int main () {
int test [5] = {0, 1, 2, 3, 4};
list<string> listTest;
string str2 = " (";
string str = "fail";
string temp = "word";
int x = 5;
for (int i = 0; i < 5; i++) {
x = test[i];
stringstream convert (stringstream::in | stringstream::out);
convert << x;
convert >> temp;
temp = convert.str();
convert.clear();
convert.str("");
str = temp + str2;
//it gets into str fine and then when you go to put
//it into the list something is messing up.
cout << str << endl;
listTest.push_back(str);
}
So basically, the string str is being created fine, but then when I go to add it to the list using push_back() for some reason it's not being added correctly and I can't figure out why. Any ideas? Thanks so much!