C++ C++;给出一个错误

C++ C++;给出一个错误,c++,C++,您好,我在此程序中有一个错误,即wcout不是“std”的成员。正如你所看到的,我也使用了iostream,但不起作用。我有Dev-C++4.9.9.2,我的操作系统是xpsp3 我需要你的帮助。 谢谢你的空闲时间 #include <iostream> #include <cstring> #include <cwchar> using namespace std; const wchar_t alphabet[] ={'A', 'B', 'C', 'Ç',

您好,我在此程序中有一个错误,即wcout不是“std”的成员。正如你所看到的,我也使用了iostream,但不起作用。我有Dev-C++4.9.9.2,我的操作系统是xpsp3 我需要你的帮助。 谢谢你的空闲时间

#include <iostream>
#include <cstring>
#include <cwchar>
using namespace std;
const wchar_t alphabet[] ={'A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H', 'I',
                        'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P', 'R', 'S',
                        'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z', '0', '1', '2', '3',
                        '4', '5', '6', '7', '8', '9', '.', ',', ':', ';', ' '};
const int char_num =44;

void cipher(wchar_t word[], int count, int key)
{
    int i = 0;
    while(i < count) {
        int ind = -1;
        while(alphabet[++ind] != word[i]) ;
        ind += key;
        if(ind >= char_num)
            ind -= char_num;
        word[i] = alphabet[ind];
        ++i;
    }
}

void decipher(wchar_t word[], int count, int key)
{
    int i = 0;
        while(i < count) {
        int ind = -1;
        while(alphabet[++ind] != word[i]) ;
        ind -= key;
        if(ind < 0)
            ind += char_num;
        word[i] = alphabet[ind];
        ++i;
    }
}

int main()
{
    wchar_t text[] = L"ABJT;";
    int len = wcslen(text);
    std::wcout << text << std::endl;
    cipher(text, len, 2);
    std::wcout << text << std::endl;
    decipher(text, len, 2);
    std::wcout << text << std::endl;
    return 0;
}
#包括
#包括
#包括
使用名称空间std;
const wchar_t字母表[]={'A','B','C','ch','D','E','F','G','Ğ','H','I',
‘İ’、‘J’、‘K’、‘L’、‘M’、‘N’、‘O’、‘Ö’、‘P’、‘R’、‘S’,
Ş、T、U、Ü、V、Y、Z、0、1、2、3、,
'4', '5', '6', '7', '8', '9', '.', ',', ':', ';', ' '};
常量int char_num=44;
无效密码(wchar_t word[],整数计数,整数密钥)
{
int i=0;
而(我<计数){
int ind=-1;
而(字母[++ind]!=单词[i]);
ind+=键;
如果(ind>=char\u num)
ind-=字符数;
单词[i]=字母表[ind];
++一,;
}
}
无效解密(wchar_t word[],整数计数,整数键)
{
int i=0;
而(我<计数){
int ind=-1;
而(字母[++ind]!=单词[i]);
ind-=键;
if(ind<0)
ind+=字符数;
单词[i]=字母表[ind];
++一,;
}
}
int main()
{
wchar_t text[]=L“ABJT;”;
int len=wcslen(文本);

std::wcout如果您使用MinGW进行编译,。如果您确实需要它,另一种选择是使用该库作为libstdc++的替代品。

您使用的Dev-C++4.9.9.2附带了MinGW gcc 3.4.2,它可能没有如sftrabbit所建议的那样正确支持宽字符


如果您在sourceforge查看原始版本的顶部,您会发现它已被取代。如果您需要广泛的字符支持,我建议您使用它,因为它打包了一个更新版本的MinGW gcc。

有趣的是,
wcout
wstring
在我的MinGW中已经运行了很长时间。@chris可能是这样的由于最近进行了移植,而询问者使用的是旧版本?但该页面尚未更新。可能。我注意到MinGW站点的某些部分在过去未得到维护。您是否尝试过更新版本?我现在尝试过,但同样的问题是:(在尝试新版本之前,您是否先卸载旧版本?我刚刚测试了它,它对我来说编译得很好。可能是的副本。)