Roger Luo

超越梦想一起飞
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年11月8日

摘要: convert char * to wchar_t *using mbstowcs function char psz[] = {"helloworld\0"}; wchar_t pwsz [10] = {0}; int len = strlen(psz); int ret = mbstowcs(pwsz, psz, min(len, 10)); cout<<ret<<endl; wcout<<pwsz<<endl;Note: if the dest has less space than src, that will cau 阅读全文

posted @ 2012-11-08 16:05 Roger Luo 阅读(179) 评论(0) 推荐(0) 编辑

摘要: Debug logSometimes we need to print some logs to show the application is running well during debug. But for release version, we choose to ignore these logs.So we can use macros to finish these function, in that way, no need to change the code.#ifdef _DEBUG #define DPRINT(...) printf(__VA_ARGS__) #el 阅读全文

posted @ 2012-11-08 12:56 Roger Luo 阅读(191) 评论(0) 推荐(0) 编辑