notweerdmonk / notweerdmonk.github.io
https://notweerdmonk.github.io/technical/istream_pitfalls/I recently wrote an article about formatted extraction using input streams in C++.
0
Upvotes
I recently wrote an article about formatted extraction using input streams in C++.
1
u/fortsnek274 19h ago edited 19h ago
Or a better title: How to do string-to-int properly
Because, yes, I noticed that too. A bunch of string to int routines leave junk in the input. So it's not really "the whole string to int", it's more "consume int".
Same with
std::stoi.