上次在xcode下,使用printf直接在调试窗口可以看到输出的信息,在vs2010中没有看到,于是查看了源代码,找到函数cclog
void cclog(const char * pszformat, ...){ char szbuf[max_len]; va_list ap; va_start(ap, pszformat); vsnprintf_s(szbuf, max_len, max_len, pszformat, ap); va_end(ap); wchar wszbuf[max_len] = {0}; multibytetowidechar(cp_utf8, 0, szbuf, -1, wszbuf, sizeof(wszbuf)); outputdebugstringw(wszbuf); outputdebugstringa(\n);}
看看它的实现吧。
使用cclog代替printf后就可以在调试窗口看到输出信息。
在vs2010中 调试->输出,可以调出输出窗口。
