smk@axiom.UUCP (Steven M. Kramer) (02/10/84)
What will: fprintf (file, "string with zero %c in it\n", '\0'); do on YOUR machine (assuming file is properly decared to be FILE * and a file is opened OK...). For you slow ones, the point is will the zero byte actually get printed out? If not, your doprnt has a bug. Some doprnt()s know the character argument is turned into an integer (basic C stuff). Doprnt reads bytes, checks to see if 0, if so, backs up in the resultant string and then goes to the next byte for sizeof(int)/sizeof(char) on your machine. The bug is that you can't print a '\0'! ...and yes, I want to for instance when I want to write strings to a file WITH the null byte. -- --steve kramer {allegra,genrad,ihnp4,utzoo,philabs,uw-beaver}!linus!axiom!smk (UUCP) linus!axiom!smk@mitre-bedford (MIL)