Work 版 (精华区)

发信人: Elsevier (elsevier), 信区: Work
标  题: char的范围
发信站: 哈工大紫丁香 (2001年11月18日18:09:40 星期天), 站内信件

在vc++的msdn中搜索char
结果
              byees   other names   range of values
char             1    signed char    –128 to 127 
unsigned char    1    none             0 to 255 


The char type is used to store the integer value of a member of the 
representable character set. That integer value is the ASCII code 
corresponding to the specified character. 

Microsoft Specific —>

Character values of type unsigned char have a range from 0 to 0xFF 
hexadecimal. A signed char has range 0x80 to 0x7F. 
These ranges translate to 0 to 255 decimal, 
and –128 to +127 decimal, respectively. 
The /J compiler option changes the default from 
signed to unsigned.

END Microsoft Specific


The int and unsigned int types have the size of the system word.
 This is two bytes (the same as short and unsigned short) in 
MS-DOS and 16-bit versions of Windows, and 4 bytes in 32-bit operating
 systems. However, portable code should not depend on th

size of int.

  --
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.229.133]
--
※ 修改:·Elsevier 於 11月18日18:27:15 修改本文·[FROM: 202.118.229.133]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.170毫秒