Sunday, May 10, 2009

Suggest a definition for printf statement in c?

not just declaration or prototypes..a complete function definition for printf...header files have only declarations...

Suggest a definition for printf statement in c?
hmm, a off handed code that I could come up with..


int printf(const char *format, va_list ap)


{


va_list aq = ap;


va_start();


/* some platform dependent code that will be wrapped under C functions */


increment the counter by one for every character written to stdout.


va_end();


return counter;


}





A rather rough code.. or rather pseudo code.
Reply:Visit http://borland.com this is the only place where you may get desired information
Reply:search for the trio project, it's a string library which implements printf. it's very long and complex.


No comments:

Post a Comment