Xref: utzoo comp.os.msdos.programmer:1195 alt.msdos.programmer:2147 Path: utzoo!utgpu!cs.utexas.edu!wuarchive!udel!cis.udel.edu From: shearer@cis.udel.edu (Rob Shearer) Newsgroups: comp.os.msdos.programmer,alt.msdos.programmer Subject: ReDirecting printf to memory???? Message-ID: <31926@nigel.ee.udel.edu> Date: 30 Sep 90 02:50:15 GMT Sender: usenet@ee.udel.edu Followup-To: comp.os.msdos.programmer Organization: University of Delaware Lines: 33 Nntp-Posting-Host: sol.cis.udel.edu Originator: shearer@cis.udel.edu 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 will let me store data straight into the screen, but right now I would rather redirect all output to a memory location, then when I want the data on my screen, to give a command that will swap it in.. For example (Semi-Psuedo Code): main () { unsigned int * scrn; scrn = MK_FP(0xb800); /* Assuming Color Monitor of course */ scrn[0] = 0x0900+'A'; printf("Hello, World\n"); } the scrn[0] will put a white (grey?) A on the screen in the upper left corner. But I would like to do some remapping so that printf will put Hello, World into a variable like scrn so I can copy scrn to the actual screen memory area at a later time. 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...) Any help would be GREATLY appreciated! -Robb Shearer shearer@sol.cis.udel.edu