Logo

Programming-Idioms

History of Idiom 22 > diff from v66 to v67

Edit summary for version 67 by programming-idioms.org:
Restored version 65

Version 66

2019-02-25, 17:30:43

Version 67

2019-03-03, 16:05:47

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Illustration

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Illustration
Extra Keywords
int base conversion
Extra Keywords
int base conversion
Imports
#include <cstdlib>
Imports
#include <cstdlib>
Code
printf("lol")
Code
int i = std::atoi(s);
Comments bubble
s is a char*
Comments bubble
s is a char*
Doc URL
http://en.cppreference.com/w/cpp/string/byte/atoi
Doc URL
http://en.cppreference.com/w/cpp/string/byte/atoi