Currently I'm making an application and try to get a value from a textBox and convert it then to an integer for further use. I have the following code:
System::String^ maxTTL = textBoxMaxTTL->Text;
std::string bla = marshal_as<std::string>(maxTTL); //System string^ to std::string
int maxTTL2 = std::atoi(bla.c_str());
It seems that maxTTL2 still got the value of '0'. When I use the stoi
argument it throws the following exception: stoi argument out of range. Has somebody an idea to resolve this?