#include <cstdlib>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
template <class T>
void convertFromString(T &, const std::string &);
int main(int argc, char *argv[])
{
std::string s("140.127.34.222");
cout << "IP Address: " << s << endl;
int a = 0;
convertFromString(a,s);
std::cout << a << std::endl;
cout << a << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
template <class T>
void convertFromString(T &value, const std::string &s)
{
std::stringstream ss(s);
ss >> value ;
}
I2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHNzdHJlYW0+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp0ZW1wbGF0ZSA8Y2xhc3MgVD4Kdm9pZCBjb252ZXJ0RnJvbVN0cmluZyhUICYsIGNvbnN0IHN0ZDo6c3RyaW5nICYpOwoKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKewogICAgc3RkOjpzdHJpbmcgcygiMTQwLjEyNy4zNC4yMjIiKTsKICAgIGNvdXQgPDwgIklQIEFkZHJlc3M6ICIgPDwgcyA8PCBlbmRsOwogICAgCiAgICBpbnQgYSA9IDA7CiAgICBjb252ZXJ0RnJvbVN0cmluZyhhLHMpOwogICAgc3RkOjpjb3V0IDw8IGEgPDwgc3RkOjplbmRsOwogICAgY291dCA8PCBhIDw8IGVuZGw7CiAgICAKICAgIHN5c3RlbSgiUEFVU0UiKTsKICAgIHJldHVybiBFWElUX1NVQ0NFU1M7Cn0KCnRlbXBsYXRlIDxjbGFzcyBUPgp2b2lkIGNvbnZlcnRGcm9tU3RyaW5nKFQgJnZhbHVlLCBjb25zdCBzdGQ6OnN0cmluZyAmcykKewogICAgc3RkOjpzdHJpbmdzdHJlYW0gc3Mocyk7CiAgICBzcyA+PiB2YWx1ZSA7Cn0g