Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!uw-beaver!cornell!rochester!uhura.cc.rochester.edu!ee.rochester.edu!rochgte!f201.n260.z1.FIDONET.ORG!John.Passaniti From: John.Passaniti@f201.n260.z1.FIDONET.ORG (John Passaniti) Newsgroups: comp.lang.c Subject: How can I send the null character to the printer? Message-ID: <40.26FE7D77@rochgte.FIDONET.ORG> Date: 24 Sep 90 14:38:52 GMT Sender: ufgate@rochgte.FIDONET.ORG (newsout1.26) Organization: FidoNet node 1:260/201 - Age Of Chance, Rochester NY Lines: 35 > From: bmyers@garnet.berkeley.edu (Brian Myers) > > In order to define some downloadable characters for my > dot matrix printer, I have to send it a series of > character values encoding the bit patterns for the new > characters. Some of those encoded values are zero. Of > course if I send a string like "\x00\x20\xF3" to stdprn > with a function like fputs, nothing gets sent, because > the first \x00 is interpreted as the end of the string. > Do I need to do a direct bios call (bios_printer)? > I can certainly manage that, but I just wondered if I > was missing some more obvious solution within the more > standard C functions... First, if you haven't already, you'll probably want to make sure the stdprn stream is opened in binary mode. I believe by default it is in text mode. Maybe not-- I don't remember. Second, you'll probably want to use a function like fwrite() to download the characters to the printer. fwrite() will take a count of how many bytes to send from a buffer; it doesn't use any embedded zeroes to determine where to stop. Hope it helps. -- *%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%* John Passaniti - via FidoNet node 1:260/230 UUCP: ...!rochester!ur-valhalla!rochgte!201!John.Passaniti INTERNET: John.Passaniti@f201.n260.z1.FIDONET.ORG *%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*