stringstream

I have a project that needs to read an integer of any size between 0 to 20. So I thought I could use stringstream, but whenever the size gets larger than 10, it just gives this one set number: 2147483647. Being quite new to c++, is there a way to fix this, maybe another thing to use instead of stringstream, or increasing the size stringstream could take.
All the built-in integer types in C++ have fixed sizes so they can only store values up to a certain limit. 2147483647 is the largest value that can be stored in a signed 32-bit integer. Using a bigger integer type such as std::int64_t (or long long) will allow you to store values up to 9223372036854775807.
Topic archived. No new replies allowed.