In this case, line 23 constructs a stringstream from mystr, then uses it as an input stream to read from it into yours.year effectively letting the stream do the conversion from the string into an int.