[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: g++/gcc and type long long
From: |
Paul Jarc |
Subject: |
Re: g++/gcc and type long long |
Date: |
26 Jan 2001 15:33:05 -0500 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 |
"Nicholas Dimas" <ndimas@primaryknowledge.com> writes:
> int main ( )
> {
> static long long LOWER48 = ( long long )0xFFFFFFFFFFFFL;
> printf( "%i\n", sizeof(LOWER48));
> return 0;
> }
>
> g++ -o lnd longlong.c
> longlong.c: In function `int main()':
> longlong.c:8: integer constant out of range
You're casting the constant to long long, but the constant itself is
only long, and the value is too large for that type. Use LL as the
suffix to make the constant long long.
paul