Hi, I have a problem, and I can't find the answer.
How do you add a string and an int, and push it into a vector.
thanksCode:int i = 5; vector<string> vs; vs.push_back(string("hello") + i);
Hi, I have a problem, and I can't find the answer.
How do you add a string and an int, and push it into a vector.
thanksCode:int i = 5; vector<string> vs; vs.push_back(string("hello") + i);
the integer itself has to be converted into a character array (string) and then you can add two together....
look up the: itoa() function.........
Use stringstreams
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi