Hi, I don't understand why the last row in the terminal is not 5. When I comment out "ss >> name" or use a new stringstream just for weight this works. Why? (Text in quotation in terminal is input.)
stringstream works similar to file stream and console stream - except uses a string for data instead of file or console. So the open modes, and stream state etc are similar to that for files/console etc.