相关讨论
类库这么写的:
const wstring RegHelper::ReadKey() const
{
wstring returnValue;
int count=0;
//get size here
count=10;
returnValue.reserve(count);
//fill returnValue
xxx;
//这里就...
by
gqgl
-
C/C++
-
2008-04-10 14:27:12 阅读(1488) 回复(1)
我用:
std::wstring name = "abc";
std::wcout<< "name:" << name;
可是屏幕上没有输出,这是怎么回事啊?我的g++是3.3版的。
我在solaris 8 (x86) gcc 3.3.2上使用wstring 类型编译报错,wstring没有定义,有人用过wstring 类型么,好像有人在vc在使用没问题,但在unix和lunix下怎么用,对了,我也在redhat 9上编译,也不行。
源码如下:
#include ;
#include ;
int main()
{
wstring s=L"hellO";
cout<wstring' undeclared (first use this function)
a.cpp:...
一段程序如下:
#include
#include
int main()
{
wstring s=L"hellO";
cout<wstring' undeclared (first use this function)
a.cpp:5: (Each undeclared identifier is reported only once
a.cpp:5: for each function it appears in.)
a.cpp:5: parse error before `='
a.cpp:6: `s' undeclared (first use ...
我在windows上写了个小程序,VC:[code]
#include
#include
using namespace std;
int main(void){
string s("ab你好");
wstring ws(L"ab你好");
for(auto it = s.begin(); it != s.end(); ++ it ){
printf("%x,",*it);
}
cout<
我用VC2012写了个小的控制台程序[code]
int main(){
cout<wstring ws(L"我来了");
wcout<wstring无法直接打印,还要设置什么参数?
我在ubuntu12.04中文版用gcc 4.6又测试了一遍,发现结果也是不是我想要的中文输出:[code]
cout<<"before"<wstring...
使用的存储量一样。
比较函数的输出也都一样。
单字符的string和宽字符的wstring,在处理国际化语言的时候,到底有什么效果上的不同么?
#include
#include
#include
#include