Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!uunet!mcsun!hp4nl!and!jos From: jos@and.nl (J. Horsmeier) Newsgroups: comp.lang.c Subject: Re: placing output of printf in memory: formatting strings Keywords: string, format, printf Message-ID: <965@baby.and.nl> Date: 19 Jun 91 14:31:57 GMT References: <80463@eerie.acsu.Buffalo.EDU> Organization: AND Software BV Rotterdam Lines: 21 In article <80463@eerie.acsu.Buffalo.EDU> luntz@acsu.buffalo.edu (jon e luntz) writes: >Hi, > I'm working with a serial device on a machine where I need to use a >device driver to access the port (ie. I cannot just fopen the port). The way >the driver works is it takes the output string straight from memory. What I'd >like to do is to be able to write formatted output to memory, such as that from >a printf or fprintf. Is there any way to fopen a string pointer or a memory >location, or maybe some way to redirect output to memory temporarily? I'd >appreciate any advice. > Thanks, > Jon Luntz Hi there, sprintf(3V) would do the job for you. Jos |O J.A. Horsmeier AND Software B.V. phone : +31 10 4367100 O| |O Westersingel 106/108 fax : +31 10 4367110 O| |O 3015 LD Rotterdam NL e-mail: jos@and.nl O|