May 6, 2012 at 6:18pm
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?
May 6, 2012 at 6:31pm
Please give us the code that causes this error.
May 6, 2012 at 6:45pm
Compiles without error on my 64-bit OS machine using LLVM (clang++ front end, V1.1) and g++ (V 4.4.3)
May 6, 2012 at 6:48pm
Compiling with mingw.
Is it because I have a 32 bit system?
May 6, 2012 at 6:53pm
@rozick1
Try defining your variable as unsigned _int64 a;
. As long as the number is positive, it works.
May 6, 2012 at 6:58pm
@Moschops
9223372036854775807
May 6, 2012 at 6:58pm
_int64 is non-standard and I'll be surprised if the MinGW gcc port recognises it.
May 6, 2012 at 7:01pm
It does but only with an extra underscore.