wprintf以及std::wcout输出中文的问题
2014-05-05 19:09
477 查看
wprintf以及std::wcout输出中文的问题 直接上示例: // C #include <stdio.h> #include <locale.h> int main( void ) { setlocale( LC_ALL, "chs" ); wprintf( L"你好 ); return 0; } 而c++ #include <iostream> #include <locale> using namespace std; int main( ) { locale loc( "chs" ); wcout.imbue( loc ); //这里很重要!!! std::wcout << L"你好" << endl; return 0; }
相关文章推荐
- UVA 12424 Answering Queries on a Tree (树链剖分)
- dell R710 服务器安装windows server 2003和LoadRunner11
- iOS_03_关键字、标识符、注释
- Exchange 2010 数据库副本加载后复制状态一直是失败并搁置故障分析 推荐
- 界面切换动画效果
- Linux二(创建、删除文件和文件夹命令)
- android timed output vibrator driver
- stm32之can总线过滤器研究
- ACM 图像有用区域
- IoStream
- 用注册表保存数据——DOS应用简介
- 什么是地图重度用户
- 第10周工作报告(2014.4.28~5.4)
- VC调试模式下does not contain debug information. Press OK to Continue
- NOTE 2----IDENTITY属性字段上加上NOT FOR REPLICATION设置
- hdu4441 treap
- 阿里雲服務器
- 深入探讨 Java 类加载器
- 可控硅过零导通程序--可控硅驱动程序
- POJ 1018 Communication System(枚举)