C++ convert string to uint64_t

Cauchy picture Cauchy · Feb 21, 2017 · Viewed 33.2k times · Source

I am trying to convert from a string to a uint64_t integer. stoi returns a 32 bit integer, so it won't work in my case. Are there other solutions?

Answer

Gambit picture Gambit · Feb 21, 2017

Try std::stoull if you are using C++11 or greater.

This post may also be of help. I didnt mark this as a duplicate because the other question is about C.