Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site polyof.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!mcnc!philabs!ron1!polyof!john From: john@polyof.UUCP ( John Buck ) Newsgroups: net.sources.games Subject: Re: pm help needed Message-ID: <187@polyof.UUCP> Date: Sat, 4-Jan-86 20:32:47 EST Article-I.D.: polyof.187 Posted: Sat Jan 4 20:32:47 1986 Date-Received: Tue, 7-Jan-86 04:06:52 EST References: <228@sdcc7.UUCP> Organization: Polytechnic Inst. of NY, Farmingdale Lines: 32 > I can't seem to get anything to print out to the screen when running > the pac-man like `pm'. However, if I redirect output, something is > happening. I am on a Pyramid OSx. Any ideas? > Common problem: declare the variable that is written by the 'write()' call to be type 'char' NOT 'int' on 68000/gould type machines (which arent backwards like the vax) when you do: int c; c = 'A'; write(1, &c, 1); You DO NOT get an 'A', you get a '\0' (NULL character) On a vax it works due to its peculiar byte ordering. Anyway, the fix it make a new var (or change the declaration of 'c'.) int c; char ctmp; c = 'A'; ctmp = c; write(1, &ctmp, 1); Will work. Pm has this bug. The reason it only happens on tty's is that the buffering is single char for ttys, line or block buffered for other things, like redirection and/or pipes. John Buck Polytechnic Inst. of NY Route 110 Farmingdale, NY 11735 decvax!mcnc!{philabs!ron1,rti-sel}!polyof!john