I\'m taking a part in a challenge, and just to cut to the point, in one of places in my program I need to convert string to an integer. I\'ve tried boost::lexical_cast but u
You could do it using sscanf
but I suspect it's slower than atoi
as it handles locales.
You'll definitely be interested in reading this C++ Convert String to Int Speed benchmark that features a naive implementation that is faster than atoi
.
EDIT: Another post comparing different string to int implementations: C++ String to Int.