Programming-Idioms

History of Idiom 22 > diff from v80 to v81

Edit summary for version 81 :
New C++ implementation by user [elseecay]

Version 80

2019-10-23, 11:02:47

Version 81

2019-12-02, 13:51:45

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
Code
string s("123");
int i;
std::from_chars(s.data(), s.data() + s.size(), i, 10);
Doc URL
https://en.cppreference.com/w/cpp/utility/from_chars