Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
StrToInt is a code snippet to convert a std::string to int. IntToStr converts an int to std::string.
StrToInt has multiple versions:

StrToInt using the C++98 and the STL

StrToInt using the C++98 and the Boost library

StrToInt using the C++0x and the STL

StrToInt using the C++98 and the STL
Uses std::atoi.
#include <string> |

StrToInt using the C++98 and the Boost library
Uses boost::lexical_cast.
#include <string> |

StrToInt using the C++0x and the STL
Uses std::stoi.
#include <string> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.