/ Published in: C++
URL: http://www.techbytes.ca/techbyte99.html
Expand |
Embed | Plain Text
#include <sstream> #include <iostream> using namespace std; int main() { string s = "-123"; int i; bool success; istringstream myStream(s); if (myStream>>i) success = true; else success = false; std::cout << success << std::endl; std::cout << i << std::endl; }
You need to login to post a comment.
