Programming-Idioms

History of Idiom 22 > diff from v65 to v66

Edit summary for version 66 :
[Cpp] dsd

Version 65

2017-12-27, 11:55:52

Version 66

2019-02-25, 17:30:43

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
int i = std::atoi(s);
Code
printf("lol")
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