我欲乘风yecheng.blog.chinaunix.net
yecheng_110
全部博文(78)
2007年(53)
2006年(25)
DT27
jolinok
ylke2007
saintdra
zhxd
大鬼不动
tntcheng
chenkeac
flb_2001
yyfq521
bluesky0
zjq5688
w1818618
168Kill
myoeoo
bolebdms
sxzf168
11qq22ww
分类: C/C++
2007-03-01 15:04:44
#define BUFF_SIZE 1024 void myLog(const char * format,...) { va_list argList; char buff[BUFF_SIZE]; va_start(argList,format); vsnprintf(buff,BUFF_SIZE,format,argList); va_end(argList); time_t now; struct tm *tm; time(&now); tm = localtime(&now); char buff_log[BUFF_SIZE]; snprintf(buff_log,BUFF_SIZE,"%.4d.%.2d.%.2d %.2d:%.2d:%.2d %s", tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,buff); //Now buff_log has the log information. }
上一篇:write写入0个字节的问题
下一篇:How to programmatically activate a band object
登录 注册