December 6th, 2003, 12:00 PM
How to create a printf wrapper
I am trying to create a function like:
void my_printf(char *fmt, ...) which behaves like printf, except that it will also record all the argument passed in to a text file. Can anybody tell me how to do this?
December 6th, 2003, 12:34 PM
My initial thought:
Call my_printf just like you would call printf. Inside of my_printf, use va_list, va_start, va_arg, and va_end to extract the var args. Do what you will with them. Then, call vprintf with the va_list.
You will know how many arguments were passed by the number of %'s (take %% into account, of course) in char* fmt...
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
December 6th, 2003, 12:46 PM
Click Here to Expand Forum to Full Width