Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ncar!tank!uxc!uxc.cso.uiuc.edu!osiris.cso.uiuc.edu!hood From: hood@osiris.cso.uiuc.edu Newsgroups: comp.unix.xenix Subject: NULL holy wars and a challenge Message-ID: <9800002@osiris.cso.uiuc.edu> Date: 7 Oct 88 17:06:00 GMT Lines: 73 Nf-ID: #N:osiris.cso.uiuc.edu:9800002:000:1313 Nf-From: osiris.cso.uiuc.edu!hood Oct 7 12:06:00 1988 I may be starting the "NULL Holy Wars" over again, but I'm *really* want to know if there is *ANY* machine out there that the following program will: a) not compile b) not run (and give the expected output). I rather doubt there is... Mind you, I'm not in the least concerned about warning messages from your compiler... I want to know if it will *RUN* correctly. Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV Directorate of Engineering & Housing Environmental Management Office Fort Hood, TX 76544-5057 --------------------------------------------------------------------------- main() { char *p, *s; struct junk { int i; float f; char c; }; s = "hello world\n"; p = s; printf("testing '\\0' :\t\t\t"); while(*p != '\0') { putchar(*p); p++; } p = s; printf("testing 0 :\t\t\t"); while(*p != 0) { putchar(*p); p++; } p = s; printf("testing 0L :\t\t\t"); while(*p != 0L) { putchar(*p); p++; } p = s; printf("testing (char *)0 :\t\t"); while(*p != (char *)0) { putchar(*p); p++; } p = s; printf("testing (void *)0 :\t\t"); while(*p != (void *)0) { putchar(*p); p++; } p = s; printf("testing (struct junk *)0 :\t"); while(*p != (struct junk *)0) { putchar(*p); p++; } }