Sign-up....

C++小问题,望高手解答?

#include <iostream>

#include <stdlib.h>

using namespace std;

int main(int argc, char *argv[])

{

wchar_t wc;

wc = 'b';

wout<<wc;

wc = 'y';

wout<<wc;

wc = 'e';

wout<<wc;

system("PAUSE");

return 0;

}

这个程序偶在vc,dev c++,quincy 99上都试过,不能通过。那么宽字符类型到底在哪里用呢?

[295 byte] By [msdn] at [2007-8-15 3:13:08]
# 1 Re: C++小问题,望高手解答?

不懂,没写过wout之类的

cheng19long at 2005-8-21 11:31:31 >
# 2 Re: C++小问题,望高手解答?

mark

caocheng8230 at 2005-8-21 11:45:50 >
# 3 Re: C++小问题,望高手解答?

wout??msdn也没找到?不过wchar的返回值好像应该是一个unsigned short (16-bit) 数据

xingbozy at 2005-8-21 11:47:53 >
# 4 Re: C++小问题,望高手解答?

没有人懂吗?

chenting27 at 2005-8-21 12:30:41 >
# 5 Re: C++小问题,望高手解答?

有一个CTYPE库文件没有包含进来

loveyou19840806 at 2005-8-21 14:38:56 >
# 6 Re: C++小问题,望高手解答?

写错了,晕,是wcout,不是wout,改了就行了

killer1984 at 2005-8-21 15:09:23 >
# 7 Re: C++小问题,望高手解答?

不行,试了。

chenting27 at 2005-8-21 15:59:09 >
# 8 Re: C++小问题,望高手解答?

VC下调试通过了,完全没问题,你提示的是什么错误?

killer1984 at 2005-8-21 16:04:04 >
# 9 Re: C++小问题,望高手解答?

wout undeclared.

chenting27 at 2005-8-21 16:48:05 >
# 10 Re: C++小问题,望高手解答?

---Configuration: o - Win32 Debug---

Compiling...

o.cpp

Linking...

o.exe - 0 error(s), 0 warning(s)

没有问题。完全通过

你出现wout undeclared. 看看 你加载的iostream 文件有没问题。

wanshuiqianshan at 2005-8-21 17:00:02 >
# 11 Re: C++小问题,望高手解答?

应该不会吧!偶现在用的是vs 2003,没装vs 6.0

chenting27 at 2005-8-21 17:06:03 >
# 12 Re: C++小问题,望高手解答?

回复人: chenting27(汀子) ( ) 信誉:100 2005-08-21 15:59:00 得分: 0

不行,试了。

这个试了怎么可能还是那个错?搞笑啊。。。

killer1984 at 2005-8-21 17:09:45 >
# 13 Re: C++小问题,望高手解答?

wout是什么东东啊?

MagicCarmack at 2005-8-21 17:30:03 >
# 14 Re: C++小问题,望高手解答?

偶用VC试过N次,都报错,说找不到wout这个变量。

chenting27 at 2005-8-21 19:25:14 >
# 15 Re: C++小问题,望高手解答?

你软件装的没问题吧

rain_star at 2005-8-21 19:58:53 >
# 16 Re: C++小问题,望高手解答?

你先告诉我们wout是什么啊?换成cout就可以了。但如果确实是wout,那我就要向您请教了,wout是什么。错误的信息是,wout没有定义。

fetag at 2005-8-21 20:07:55 >
# 17 Re: C++小问题,望高手解答?

这个wchar_t,意思是处理宽字符,比如汉语、日本语,但是偶试了,在dev c++ 、VC上都不能通过,想知道原因,就这么简单。(书上讲的例子)

chenting27 at 2005-8-21 20:50:58 >
# 18 Re: C++小问题,望高手解答?

标准iostream不包含吧...

crazyle at 2005-8-21 20:53:29 >
# 19 Re: C++小问题,望高手解答?

这本书,就这个例子没过,但是C++里是有这个东西,很郁闷!!!!

chenting27 at 2005-8-21 20:56:21 >
# 20 Re: C++小问题,望高手解答?

火星人,你解释的很专业呀!!!:)

chenting27 at 2005-8-21 21:53:26 >
# 21 Re: C++小问题,望高手解答?

wc = L'A';

Darkay_Lee at 2005-8-21 22:07:16 >
# 22 Re: C++小问题,望高手解答?

还有更好的回答吗?

chenting27 at 2005-8-22 9:50:39 >
# 23 Re: C++小问题,望高手解答?

good

diandian82 at 2005-8-22 9:55:31 >
# 24 Re: C++小问题,望高手解答?

还有更好的回答吗?

chenting27 at 2005-8-22 10:50:31 >
# 25 Re: C++小问题,望高手解答?

书上的例子不一定是对的,wout本人在MSDN上没有看到,不知有谁知道是什么。wcout和cout都可以通过。wout是你自己定义的吗?

melon_soup at 2005-8-22 16:58:52 >
# 26 Re: C++小问题,望高手解答?

在VC++7.0上调试通过

bugebear3 at 2005-8-22 19:34:30 >
# 27 Re: C++小问题,望高手解答?

还有没有更好的回答?没有偶结帖了!

chenting27 at 2005-8-22 20:07:12 >
# 28 Re: C++小问题,望高手解答?

wcout

K at 2005-8-22 20:20:04 >
# 29 Re: C++小问题,望高手解答?

还有更好的回答吗?

chenting27 at 2005-8-23 22:08:13 >
# 30 Re: C++小问题,望高手解答?

你想要什么更好的回答?什么是更好的回答?

guojn at 2005-8-23 22:25:21 >

C/C++

All Classified