Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

string to int c++

int number = std::stoi(string, base);  // str to int
int number = std::stoi("100",10);  // number = 100

long int number = std::strtol(string, endptr, base);  // str to long int
 
PREVIOUS NEXT
Tagged: #string #int
ADD COMMENT
Topic
Name
5+3 =