±À¤¶:| Ãh¥¥¿ç®g | ÀY·w¿ç®g | ¥¢¯v¿ç®g | ÀY¯k¿ç®g | ¸£¸~½F¿ç®g | °O¾Ð»Ùê¿ç®g | ¦Õ·l¶Ë¿ç®g | §íÆ{¿ç®g | Celine Bags | À¦¨à¥Î«~ | Loewe Bag |

µo·s¸ÜÃD
¥´¦L

¦³¨S¦³¤Hª¾¹D³oC++µ{¦¡¿ù¦b¨º¸Ì

¦³¨S¦³¤Hª¾¹D³oC++µ{¦¡¿ù¦b¨º¸Ì

#include<iostream>
#include<stdlib.h>
// The main() function
int main()
{
      wchar_t wc;       // wide char variable
      wc='b';            //assign 'b' to wc
      std:: wout << wc;   // display 'b'
      wc='y';            // assign 'y' to wc
      std:: wout << wc;   // display 'y'
      wc='e';            // assign 'e' to wc
      std:: wout << wc;   // display 'e'
      
      system("pause");
      return 0;
}


­Ó¤H»{¬°°ÝÃD¬O¥X²{¦bwout, ¦pªG±N wout§ï¬°cout ·|¤£·|§ó¦n©O??

TOP

I am not really good in c/c++.. may be wrong

I think the purpose of this exercise is meant to use 'wout' command instead of 'cout'. If this is the case, I think you need to include <stddef.h> lib.

wout is to display wide charcters, which is double size of char.

This is all I know about wout. hhl, do you have any idea? Thx

[ ¥»©«³Ì«á¥Ñ d_chu ©ó 2006-11-23 05:03 AM ½s¿è ]

TOP

Very nice to have my name mentioned ~~~~~

Simply put to compiler to try, you will find out no need to have stddef.h included, just the iostream is enough.

Also, there is only wcout, no wout ...

Yes, wcout will support two byte char set, but don't know which coding table it is referencing, or depends on system, not sure ... i can only say the different of cout and wcout is the "cout" is to display "char*" and the "wcout" is to display "wchar_t*" in the programming view ~

TOP

Thank You!!!

TOP

thanks for the info, hhl..  havn't touch c++ for 5 years. it is already good for me to still remember a command like wout or wcout.

As also mentioned from you that wcout is double of char... so... correct me if I am wrong.. In practically, is it able to store character other than english, such as chinese (2 byte unicode)?

TOP

Of course ~ just use wchar_t, you can store 2bye unicode char using wchar_t, however, for display or print it, it is another thing ... more complicated ...

TOP

Learned good idea.

TOP

use and practice are good methods

TOP

wout¤£¬OstdûHo³¥,
¦ýѸ­ø¨ì¬ÛÃöûHheader file.

¾ÚÁ¿wout«Y¥X¦ÛAl stevens¸òClayton Walnum¦XµÛªºThe C++ Programming Bible.
IT¥N¤u/Âò¤â¤@¦W!
¤p§Ì¨Ã­ø¥­, ¦ýµ´­ø«Y¶Q!

TOP

Thanks for your knowledge. I will try it out..

TOP

§Ú·P觉´³¥D学习编µ{¦³点¨«¤J误区

TOP

wc='b';            //assign 'b' to wc
      std:: wcout << wc;   // display 'b'
      wc='y';            // assign 'y' to wc
      std:: wcout << wc;   // display 'y'
      wc='e';            // assign 'e' to wc
      std:: wcout << wc;   // display 'e

OK!

TOP

¦n东¦è §Ú³ß欢 谢谢¤À¨É¦n东¦è §Ú³ß欢 谢谢¤À¨É

TOP

¤Þ¥Î:
­ì©«¥Ñ keen ©ó 2007-1-1 21:13 µoªí
§Ú·P觉´³¥D学习编µ{¦³点¨«¤J误区
ªB¤Í, §A¥i¤£¥i¥H¨ãÅé¦a§i¶D§Ú??

TOP

¤Þ¥Î:
­ì©«¥Ñ jayzhou_2046 ©ó 2006-12-7 14:33 µoªí
wout¤£¬OstdûHo³¥,
¦ýѸ­ø¨ì¬ÛÃöûHheader file.

¾ÚÁ¿wout«Y¥X¦ÛAl stevens¸òClayton Walnum¦XµÛªºThe C++ Programming Bible.
§A»¡±o¥¿½T!!
¦]¬°³oµ{¦¡¬O¤£¯à°õ¦æ

TOP

µo·s¸ÜÃD


­«­nÁn©ú¡G¥»°Q½×°Ï¬O¥H§Y®É¤W¸ü¯d¨¥ªº¤è¦¡¹B§@¡A¥»ºô¯¸¹ï©Ò¦³¯d¨¥ªº¯u¹ê©Ê¡B§¹¾ã©Ê¤Î¥ß³õµ¥¡A¤£­t¥ô¦óªk«ß³d¥ô¡C¦Ó¤@¤Á¯d¨¥¤§¨¥½×¥u¥Nªí¯d¨¥ªÌ­Ó¤H·N¨£¡A¨Ã«D¥»ºô¯¸¤§¥ß³õ¡A¥Î¤á¤£À³«H¿à¤º®e¡A¨ÃÀ³¦Û¦æ§PÂ_¤º®e¤§¯u¹ê©Ê¡C©ó¦³Ãö±¡§Î¤U¡A¥Î¤áÀ³´M¨D±M·~·N¨£(¦p¯A¤ÎÂåÀø¡Bªk«ß©Î§ë¸êµ¥°ÝÃD)¡C¥Ñ©ó¥»°Q½×°Ï¨ü¨ì¡u§Y®É¤W¸ü¯d¨¥¡v¹B§@¤è¦¡©Ò³W­­¡A¬G¤£¯à§¹¥þºÊ¹î©Ò¦³¯d¨¥¡A­YŪªÌµo²{¦³¯d¨¥¥X²{°ÝÃD¡A½ÐÁpµ¸§Ú­Ì¡C¥»°Q½×°Ï¦³Åv§R°£¥ô¦ó¯d¨¥¤Î©Úµ´¥ô¦ó¤H¤h¤W¸ü¯d¨¥¡A¦P®É¥ç¦³¤£§R°£¯d¨¥ªºÅv§Q¡C¤Á¤Å¼¶¼g²Ê¨¥Â©»y¡B½ÚÁ½¡B´è¬V¦â±¡¼É¤O©Î¤H¨­§ðÀ»ªº¨¥½×¡A·q½Ð¦Û«ß¡C¥»ºô¯¸«O¯d¤@¤Áªk«ßÅv§Q¡C


Copyright 1997- Xocat. All Right Reserved.