A chceš jenom smazat mezery ze začátku nebo ze stringu udělat int? Takhle je těžko radit, když nevíš, na čem ti padá kompilace. std::string number = " 32000"; std::cout << std::stoi(number) << std::endl; std::string::size_type pos = number.find_first_not_of(" \t"); std::string noWhiteSpaces = number.substr(pos); std::cout << "'" << noWhiteSpaces << "'" << std::endl;