初学者 关于wchar_t 求助!!!!
程序代码:#include <iostream>
using namespace std;
int main()
{
wchar_t sex;
cin>>sex;
cout<<sex;
return 0;
}我看书上说wchar_t类型可以储存汉字,想用它来存储性别。我这样写为什么错了?
程序代码:#include <iostream>
using namespace std;
int main()
{
wchar_t sex;
cin>>sex;
cout<<sex;
return 0;
}
2013-03-14 20:38
2013-03-14 21:04
2013-03-14 21:18
2013-03-14 21:21
2013-03-14 21:32
2013-03-14 21:46
2013-03-14 22:09
程序代码:#include <iostream>
using namespace std;
int main()
{
locale::global( locale(locale(),"",LC_CTYPE) );
wchar_t sex;
wcin >> sex;
wcout << sex;
return 0;
}
2013-03-15 08:22
2013-03-15 11:02
2013-03-15 11:06