I have some where in my code the next line: long long maxCPUTime=4294967296;
(the largest number long type can be is 4294967296 -1 , so I used long long)
the problem is, when I compile ,I get the next error:
error: integer constant is too large for ‘long’ type
Its as if, eclips doesn't recognize that I wrote 'long long' and it thinks I wrote 'long'.
(I'm using linux os)
anyone knows why I get this error?
Append
LL
to it:That should solve the problem. (
LL
is preferred overll
as it's easier to distinguish.)long long
wasn't officially added to the standard until C99/C++11.Normally, integer literals will have the minimum type to hold it. But prior to C99/C++11,
long long
didn't "exist" in the standard. (but most compilers had it as an extension) So therefore (under some compilers) integer literals larger thanlong
don't get thelong long
type.