🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2495

Re: ReDirecting printf to memory????

#2495
From: Risto Lankinen
Date: Wed, 03 Oct 1990 08:26
22 lines
1343 bytes
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     ***************************************
Technical Details
Message-ID: <795@tuura.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!santra!fuug!tuura!risto
References: <31926@nigel.ee.udel.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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