似曾相识 不过是个Bug...

大狗的窝~

2012年9月16日

控制台程序的中文输出乱码问题,printf,wprintf与setlocale

摘要: #include <stdio.h>#include <wchar.h>int main(void) { char str[] = "中文"; wchar_t wstr[] = L"中文"; printf("1:%s\n", str); wprintf(L"2:%s\n", wstr); return 0;}Windows平台下VS2008输出:Windows平台下MinGW输出:当加上setlocale函数设定后,#include <stdio.h>#include <l 阅读全文

posted @ 2012-09-16 21:35 Mr.DejaVu 阅读(26424) 评论(3) 推荐(7) 编辑

导航

for myself...