2

If I write this program -

main(){printf("%d",unix);}

this compiles correctly, and prints 1, although I had expected an 'unix undeclared' or similar error. But if I change to this-

main(){printf("%d",blah);}

This gives error-

error: 'blah' undeclared (first use in this function)

as expected.

So, why does unix does not generate an error, and why is it's value 1? I tried Googling but nothing came up.

1 Answers1

1
#undef unix
int main(void)
{printf("%d\n",unix);
return 0;
}

Fails to compile (even after #include <stdio.h>, so, it must be some builtin preprocessor ~#define Compiler output:

unix.c: In function ‘main’:
unix.c:4:16: error: ‘unix’ undeclared (first use in this function)
 {printf("%d\n",unix);
wildplasser
  • 43,142
  • 8
  • 66
  • 109