Dale DuRose wrote:
#include <stdio.h>
int main(){
       int i;
       for(i = 4; i; i--){
               printf("%d\n", i);
       }
}

output is:
4
3
2
1

So thats four loops the statement is false when i is 0.

C doesn't have a boolean type.  Have a look in a header file and you'll see
#define TRUE 1
#define FALSE 0

In reality, 0 is false, non-zero is true.

You'll see this all over the place, like

if( !strchr( haystack, needle ) )
...

Cheers, Rex

Reply via email to