/ Published in: C++
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#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; }
URL: http://www.techbytes.ca/techbyte99.html