Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

substring to int c++

// Convert 2 character substring from position 0 to an integer
int num = std::stoi(s.substr(0, 2));
 
PREVIOUS NEXT
Tagged: #substring #int
ADD COMMENT
Topic
Name
7+3 =