I'm trying to convert a string of an arbitrary length to an int but so far it works only for strings of limited length. Code so far:
long long convertToInt (std::string x){
long long number;
std::istringstream ss(x);
ss >> number;
return number;}
for x=100000000000000000000000001
the function returns 0
. Could someone explain why? Thanks.