G
Gernot Frisch
Can I convert a std::string to a std::istream object?
Can I convert a std::string to a std::istream object?
Gernot Frisch said:Can I convert a std::string to a std::istream object?
Victor Bazarov said:No. But you can create an std::istringstream object with it:
std::string mystring("1 2 3");
std::istringstream is(mystring);
int one, two, three;
is >> one >> two >> three;
Of course, my effort is wasted if that's not what you wanted. Next
time please be more verbose trying to explain what you need instead
of asking about legality of a potential solution to your task.
Gernot Frisch said:[...]
Was it hard to understand?
[...]
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.