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

关于宽字符的有关问题

2012-02-08 
关于宽字符的问题!wchar_t*b_T( asdf )wchar_t*m_Pathm_Path(wchar_t*)malloc(_tcslen(b)+1)_tcscp

关于宽字符的问题!
wchar_t   *b   =   _T( "asdf ");
wchar_t   *m_Path;
m_Path   =   (wchar_t   *)malloc(_tcslen(b)   +   1);
_tcscpy(m_Path,b);
free(m_Path);
这段程序走到free那就报错,宽字符不能这样释放???应该怎么做呢???

[解决办法]
malloc(sizeof(wchar_t) * (_tcslen(b) + 1));

热点排行
Bad Request.