So I need to store a large (trillion) number and am trying to use unsigned long long int.
But when trying to store it, it says that "error: integer constant is too large for "long" type".
Using ULONG_LONG_MAX= 18446744073709551615 which is much larger than my number.
What is happening here?
Please give us the code that causes this error.
Compiles without error on my 64-bit OS machine using LLVM (clang++ front end, V1.1) and g++ (V 4.4.3)
Compiling with mingw.
Is it because I have a 32 bit system?
@rozick1
Try defining your variable as unsigned _int64 a;
. As long as the number is positive, it works.
@Moschops
9223372036854775807
_int64 is non-standard and I'll be surprised if the MinGW gcc port recognises it.
It does but only with an extra underscore.