Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!rochester!rit!cci632!ccicpg!felix!asylvain From: asylvain@felix.UUCP (Alvin E. Sylvain) Newsgroups: comp.os.msdos.programmer Subject: Re: ReDirecting printf to memory???? Message-ID: <151836@felix.UUCP> Date: 2 Oct 90 20:03:12 GMT References: <31926@nigel.ee.udel.edu> Sender: daemon@felix.UUCP Reply-To: asylvain@felix.UUCP (Alvin E. Sylvain) Organization: FileNet Corp., Costa Mesa, CA Lines: 28 In article <31926@nigel.ee.udel.edu> shearer@cis.udel.edu (Rob Shearer) writes: >Hello! Yet another cryptic question that may sound very weird! > >I am interested in making printf (and anything else that would print to >the screen) print to a memory location instead. > >I know how to create a variable (I am using TC++ by the way) that [ ... ] Use sprintf to write to arrays, then printf the arrays. char arr [MAX_CHARS] ... sprintf (arr, "%s", str); sprintf (arr [some_offset], "The answer is %d\n", answer); ... printf (arr); /* ... to your device, however the heck you want it */ > ... The catch is, I am trying to do this >with out changing all my printfs that I have (or any console output be it >printf, putch, putchar etc...) Yeah, and I want it to print guaranteed future winning Lotto numbers. -- -=--=--=--"BANDWIDTH?? WE DON'T NEED NO STINKING BANDWIDTH!!"--=--=--=- "If you come in at 10am and leave at 7pm one day, then come in at 6am and leave at 3pm the next day, people will deduce that you are coming in at 10am and leaving at 3pm every day." --- me