首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

CTime转成CString出现DEBUG ASSERTION failed解决办法

2012-03-09 
CTime转成CString出现DEBUG ASSERTION failedC/C++ code///我用的是VS2008CTime t CTime::GetCurrentTim

CTime转成CString出现DEBUG ASSERTION failed

C/C++ code
   ///我用的是VS2008         CTime t = CTime::GetCurrentTime();            CString strTime = _T("(%y-%m-%d %H:%M:%str)");            strTime = t.Format(strTime);  //这里出错了。不知道为什么?


[解决办法]
CTime t = CTime::GetCurrentTime();
CString strTime = _T("%y-%m-%d %H:%M:%S"); //多了括号
strTime = t.Format(strTime);
[解决办法]

:%str

:%S
就可以了
CTime的Format中,没有%str格式的
与()无关,只是结果会多对()

热点排行