Re: How does printf() works
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Sat, 22 Mar 2008 14:44:25 -0000
"Sanchit" <sanchitgupta.1@xxxxxxxxx> wrote in message news:cbdde0a1-0a51-46cf-a671-dd590d918bad@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I want to know how does printf (stdio library function) works? DoesThink how you'd write a cutdown sprintf(). Let it take only %d, %c and %s format specifiers.
this depand on complier (I am using gcc on Linix)
Does it uses some buffer in which it stores all what needed to be
printed and in end of program it prints that or something else.
You'd have to set up a variable argument list, then step through the format string to determine what had been passed, then call va_arg with the right type to get the argument. Then you need to convert ints to human-readable ascii characters, and pass out to the buffer.
printf() works in roughly the same way, though with lots of bells and twiddles.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
.
- References:
- How does printf() works
- From: Sanchit
- How does printf() works
- Prev by Date: Re: Keep getting a warning.. Can someone please tell me why?
- Next by Date: hot water heaters, incest xxx, lesbiennes, magazine ads, male body galleries, marge simpson sex, men stripping
- Previous by thread: Re: How does printf() works
- Next by thread: How do i increase the size of the program stack?
- Index(es):
Relevant Pages
|