L
labros07
Hello to all !
----------------
#include <stdio.h>
int main()
{
/*size_t i;*/
int i;
for(i=10 ;i>=0; i--){
printf("%d\n", i);
}
return 0;
}
In the above code if I make 'i' to be of type size_t, when i = -1 the
comparison i>=0 is true and loop executes
even when i<0. Does anyone knows why ?
I use:
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Thanks,
----------------
#include <stdio.h>
int main()
{
/*size_t i;*/
int i;
for(i=10 ;i>=0; i--){
printf("%d\n", i);
}
return 0;
}
In the above code if I make 'i' to be of type size_t, when i = -1 the
comparison i>=0 is true and loop executes
even when i<0. Does anyone knows why ?
I use:
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Thanks,