在c和c++中,可变参数使用的最多函数有:scanf,printf,以及fprintf,fscanf,sprintf等,MFC也提供CString::Format实现可变参数。本文提供用va_list实现自己的可变参数函数,应用场合包括:程序的写日志功能。示例代码如下:代码参考文献:http://www.cplusplus.com/reference/clibrary/cstdio/vsprint... Read More
posted @ 2010-08-03 22:41 stuarts Views(729) Comments(0) Diggs(0) Edit