C++ - repeatedly using istringstream

前端 未结 2 1704
夕颜
夕颜 2020-11-29 08:43

I have a code for reading files with float numbers on line stored like this: \"3.34|2.3409|1.0001|...|1.1|\". I would like to read them using istringstream, but it doesn\'t

2条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 08:59

    After setting the row into the istringstream...

    separate.str(row);
    

    ... reset it by calling

    separate.clear();
    

    This clears any iostate flags that are set in the previous iteration or by setting the string. http://www.cplusplus.com/reference/iostream/ios/clear/

提交回复
热议问题