Say I have a string object called line which contains:
Number: 3423
and I want to do the following:
string keyword;
int number;
stringstream(line) >> keyword >> number;
But I only want to extract the number, and am not interested in the keyword.
is there a way of doing this without having to declare a string object?
You can use
istream::ignore: