I have a stringstream
and must find out if it ends with a certain word or not. How do you iterate over the stringstream
and pick out the last string?
It's a school excercise in which you are not allowed to use iterators or any other magic.
I have a stringstream
and must find out if it ends with a certain word or not. How do you iterate over the stringstream
and pick out the last string?
It's a school excercise in which you are not allowed to use iterators or any other magic.
Copyright © 2021 Jogjafile Inc.
A string stream is kind of like snprintf in C, so you actually convert it to a string via the
.str()
method. This is a basic example: To actually get all the worlds you will have to split on space, and put it into an array or vector, or something.