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

下面这三地方是不是不支持 unicode ,要如何改

2012-03-20 
下面这三地方是不是不支持 unicode ,要怎么改?#includewindows.hofstreamout( C:\\files.txt ,ios::ou

下面这三地方是不是不支持 unicode ,要怎么改?
#include   <windows.h>


ofstream   out( "C:\\files.txt ",ios::out);       //不支持   unicode   ,要是文件名含有中文就大不开,怎么办?


WCHAR   buffer[4096];
infile.getline(buffer,4096, '\n ')         //第一噶参数不能用WCHAR*   怎么办?


wstring   temp;
cin> > temp;       //不支持   wstring   ,怎么办?

[解决办法]
2. 用TCHAR吧,自动根据情况的
[解决办法]
3.用CSting吧
[解决办法]
使用wofstream, wcout, wcin
wofstream out(L "C:\\files.txt ", ios::out);
wchar_t buffer[4096];
infile.getline(buffer,4096, '\n ')

wstring temp;
wcin> > temp;

[解决办法]
那就用wifstream ifile(...)
ifile.getline()
[解决办法]
LZ 有 #include <windows.h>

可以MFC
[解决办法]
google 如何升级基于STL的应用来支持Unicode

热点排行