Sunday, 8 September 2013

Taking output and storing it into a variable?

Taking output and storing it into a variable?

I have this code:
string text;
getline(cin ,text);
istringstream iss(text);
copy(istream_iterator<string>(iss),
istream_iterator<string>(),
ostream_iterator<string>(cout, "\n"));
What it does is when I input a string like: bf "inging" filename, it outputs
bf "inging" filename
My question is, Is there any way such that I can take each individual
output and save it into a variable.

No comments:

Post a Comment