I tried it like the source code below, but it didn't work ㅜㅜ What should I do?
std::stringstream m;
m.empty();
m.clear();
The emtpy()
member function in the standard library is query, not command.
What it means is, empty empty()
! Is it empty?That's what it means.
The clear() member function is written to clear the error state from the stream.
For example
Error state - When eofbit(end-of-file)
is 1
When clear()
is invoked, eofbit
is set to 0.
To empty stringstream
, write:
© 2024 OneMinuteCode. All rights reserved.