Can someone explain to me how does peek function work in C++?

  c++, peek, stringstream

Can somebody explain to me the following extract:
I have ss which is of type std::stringstream
I think I know what get does- moves the pointer of the stream with one position to the right.
Here, in the example I am not sure how many times will the loop execute, and also I don’t know how peek works, can you show me with some brief example?
Also, what is stringstream and how is it used?

while (ss.peek() == ' ')

ss.get();

Source: Windows Questions C++

LEAVE A COMMENT