A
AliM
Hi,
Last day I've seen a C code and I cant understand anything. It prints
invalid result. The code was like this
It look like going to print 81 but it prints 82 anormally. When try:
Also I was using gcc 3.6.2
Thanks.
Last day I've seen a C code and I cant understand anything. It prints
invalid result. The code was like this
int ar[8]={1,2,3,4,5,6,7,8};
#define SIZE (sizeof(ar)/sizeof(int)) /* this gets 8 perfectly */
int main()
{
printf("%d",SIZE);
if(-1<=SIZE)
printf("1");
else printf("2");
}
It look like going to print 81 but it prints 82 anormally. When try:
It prints 0, How do you explain this?printf("%d",-1<=SIZE);
Also I was using gcc 3.6.2
Thanks.