how can i implement my own printf()
are there any open source libraries, containing printf() implementations which i can look over?
how can i implement my own printf()
are there any open source libraries, containing printf() implementations which i can look over?
There's glibc, which is the C standard library gcc uses, but most of the code there is pretty hardcore.
which is also opensource, so why not go take a peak?
Here, this is what i have been able to achieve
any suggestions for improvements will be appreciatedCode:#include<stdarg.h> int myprintf( const char * format, ... ) { int rtn = 0; va_list args; va_start( args, format ); rtn = vprintf( format, args ); va_end( args ); return rtn; } main(void) { myprintf("Vaibhav %d %d", 10, 15); getchar(); return(0); }
Sounds like homework... but that seems okay.