Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Wt WStringToInt

 

WStringToInt is a convert code snippet to convert Wt::WString to integer.

 

#include <cstdlib>
#include <string>
#include <Wt/WString>

///WStringToInt converts Wt::WString to integer
///From http://www.richelbilderbeek.nl/CppWStringToInt.htm
int WStringToInt(const Wt::WString& s)
{
  const std::string t(s.toUTF8());
  return std::atoi(t.c_str());
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict