Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!santra!fuug!tuura!risto From: risto@tuura.UUCP (Risto Lankinen) Newsgroups: comp.os.msdos.programmer Subject: Re: ReDirecting printf to memory???? Message-ID: <795@tuura.UUCP> Date: 3 Oct 90 08:26:21 GMT References: <31926@nigel.ee.udel.edu> Organization: Nokia Data Systems Oy Lines: 22 shearer@cis.udel.edu (Rob Shearer) writes: >I am interested in making printf (and anything else that would print to >the screen) print to a memory location instead. Hi! There's a standard C library function 'sprintf', which will do what you're suggesting. The parameters are the same as in 'printf', except that before the format string you'll have to put the address of the target buffer. Normally, the target buffer is declared as an array of characters, but to send the output to any memory location, you can use a literal with a type cast to (char *) . Terveisin: Risto Lankinen -- Risto Lankinen / product specialist *************************************** Nokia Data Systems, Technology Dept * 2 2 * THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME! Now working on 2 +1 * replies: risto@yj.data.nokia.fi ***************************************