Re: C++ Integer constant is too large for "long" type
Posted 11 July 2011 - 08:15 AM
You should tell the compiler that your constant is larger than an int (-1138071060L) for a long, (-1138071060LL) for a long long. Also note that the long long is only guaranteed to be able to hold a 32 bit number, the same as a long. You can find out the limits of your system by using the functions provided in the limits include file like: numeric_limits<long>::max().
Also you can look at the climits include file to see the limits for your system.