How do you create a buffer where i can add charachters to the buffer. I then want to put this sequence of characters (the buffer) into an element of an array and then put this array into an element of a vector?
Printable View
How do you create a buffer where i can add charachters to the buffer. I then want to put this sequence of characters (the buffer) into an element of an array and then put this array into an element of a vector?
Well, to start you out, you can use ostringstream.
Now, I'm sure there's an easy way to get it into a vector, although I've never done it.Code:#include <sstream>
using namespace std;
...
ostringstream ostr;
ostr << "The answer is..." << 42 << endl;
string strAnswer = ostr.str();
Jeff