How do you convert a C++ string to an int? [duplicate]

#include <sstream>

// st is input string
int result;
stringstream(st) >> result;

Leave a Comment