Converting to C-style strings #include has some useful functions which use char * variables To convert a std::string to char *, use the c_str() method: #include std::string s = "52241"; long l = atol(s.c_str());