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

wchar_t和wstring类型输出有关问题

2012-02-13 
wchar_t和wstring类型输出问题请问怎么才能输出wchar_t和wstring类型的字符串,用cout输出不了,用wcout编译

wchar_t和wstring类型输出问题
请问怎么才能输出wchar_t和wstring类型的字符串,用cout输出不了,用wcout编译提示没这个东西.

DEV-C++环境.
#include <iostream>
#include <conio.h>
#include <string>

using   namespace   std;

int   main()
{
    char   s1[]= "char ";
    wchar_t   s2[]=L "wchar_t ";  
//wstring   ws=L "wstring ";

    cout < < "s1= " < <s1 < <endl;
    cout < < "s2= " < <s2 < <endl;//输出的是个地址
//cout < <ws < <endl;             //编译提示错误
   
       
        getch();
        return   0;
}

[解决办法]
wcout 在 VC 环境下使用

热点排行