#include <sstream> // ... std::string number; std::stringstream strstream; strstream << 1L; strstream >> number;