Lloyd Zusman writes:
Sam Varshavchik <[EMAIL PROTECTED]> writes:
[ ... ]
Here, I'll even write the code for you:
#include <stdio.h>
void main() { int i;
for (i=0; i<256; i++) { char c=(char)i; unsigned char uc=(unsigned char)i;
if ( (((c >> 7) & 1) != ((uc >> 7) & 1)) || ((c & 15) != (uc & 15))) { printf("Sam is wrong\n"); exit(0); } } printf("Sam is right\n"); exit(0); }
Please run this code, and let us know what happens.
% cat >sam.c <<EOD #include <stdio.h> void main() { int i;
for (i=0; i<256; i++) { char c=(char)i; unsigned char uc=(unsigned char)i;
if ( (((c >> 7) & 1) != ((uc >> 7) & 1)) || ((c & 15) != (uc & 15))) { printf("Sam is wrong\n"); exit(0); } } printf("Sam is right\n"); exit(0); } EOD % gcc -o sam sam.c sam.c: In function `main': sam.c:4: warning: return type of `main' is not `int' % ./sam Sam is wrong %
Either you're kidding me, or your C compiler has a bug.
pgppf61dm64tA.pgp
Description: PGP signature
