【发布时间】:2013-03-22 23:42:53
【问题描述】:
您好,我在这个程序中有一个错误,即 wcout 不是 `std' 的成员。如您所见,我也使用了iostream,但没有用。我有Dev-C++ 4.9.9.2,我的操作系统是XP SP3 我需要你的帮助。 感谢您的空闲时间。
#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;
}
【问题讨论】:
-
您是否尝试过更新版本的dev-c++ with mingw?
-
我现在试过了,同样的问题:(
-
您在尝试新版本之前是否先卸载了旧版本?我刚刚对其进行了测试,它对我来说编译得很好。
标签: c++