24小时热门版块排行榜    

查看: 252  |  回复: 1

那蜗牛真快

新虫 (小有名气)

[求助] 程序编译没有错,一运行出现exe错误,为什么 已有1人参与

#include <stdio.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
int main()
{
  const char*p="Welcome to there!";   
wchar_t out[16]={0};   
setlocale(LC_ALL,"chs";  
mbstowcs(out,p,strlen(p) );  
printf("%s", out );   
return 0;
}
这是我编的,想将ascii码字符串“welcome to there!”转换为unicode码,为什么不能实现
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lvweizhong

铜虫 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
out 分配16长度,还没有你要转换的字符串长。先把这个解决了

发自小木虫Android客户端
2楼2015-09-19 16:46:55
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 那蜗牛真快 的主题更新
信息提示
请填处理意见