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
LLto it:That should solve the problem. (
LLis preferred overllas it's easier to distinguish.)long longwasn'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 longdidn't "exist" in the standard. (but most compilers had it as an extension) So therefore (under some compilers) integer literals larger thanlongdon't get thelong longtype.