To be exact, 32 bit signed ints have a range from -2,147,483,648 - 2,147,483,647. 32 bit unsigned ints have a range from 0-4,294,967,295. 64 bit ints have a much larger possible range, signed goes from -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 and unsigned goes from 0-18,446,744,073,709,551,615. If you want to handle arbitrarily large numbers you'll have to look into arbitrary precision math libraries for C++.
Most likely what's happening is you're using a 32-bit signed (default) int, whose max value is 2,147,483,647. Add one and you actually get -2,147,483,648 (overflow).