#include<stdio.h>
void main()
{
long long a;
a=4000000000;//400 core
printf("%lld\n",a);
}
the above code does not works properly.When it is over 2147483647 then
it gives elligal result.
whats the reson.Who can help me.
Thanks.
Long Long doesn't support
Moderator: Board moderators
Long Long doesn't support
Mr. Arithmetic logic Unit
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
-
- New poster
- Posts: 8
- Joined: Tue Nov 11, 2003 11:02 pm
This shoudn't be done, since you are casting an integer constant to a long long variable.backslash null wrote:Hi,
u can alsso use type cast like this:
a=(long long) 4000000000;
printf("%lld",a);
Depending on the compiler this may or may not work as expected.
To be safe it's better to specify with LL that your constant is of long long type.
Ciao!!!
Claudio