How can I send the null character to the printer?

Jim Patterson jimp at cognos.UUCP
Tue Sep 25 03:10:44 AEST 1990


In article <15.26FC622E at ananke.stgt.sub.org> kaiser at ananke.stgt.sub.org (Andreas Kaiser) writes:
>`t BM> In order to define some downloadable characters for my dot matrix printer,
> BM> I have to send it a series of character values encoding the bit patterns
> BM> for the new characters.  Some of those encoded values are zero.
>
>Make your own 'fputs', using 'putc'. 'putc' should transmit ANY code (unless you 
>operate in text mode on a PC running MSDOS :-).

ANY (faithful) implement of fputs will have the same problem. fputs is
DEFINED to transmit only up to the first NUL, and so will never
transmit a NUL byte by definition. However, fputc or putc will work in
other contexts, as will fwrite (as someone else has already noted).
-- 
Jim Patterson                              Cognos Incorporated
UUCP:uunet!mitel!cunews!cognos!jimp        P.O. BOX 9707    
PHONE:(613)738-1440                        3755 Riverside Drive
                                           Ottawa, Ont  K1G 3Z4



More information about the Comp.lang.c mailing list