Answers for "std::string to number"

C++
3

c++ string to int

// EXAMPLE
std::string sStringAsString = "789";
int iStringAsInt = atoi( sStringAsString.c_str() );

/* SYNTAX
atoi( <your-string>.c_str() )
*/

/* HEADERS
#include <cstring>
#include <string>
*/
Posted by: Guest on June-02-2020

Browse Popular Code Answers by Language