博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++基本数据类型之Byte和char
阅读量:3904 次
发布时间:2019-05-23

本文共 234 字,大约阅读时间需要 1 分钟。

C++基本数据类型之Byte和char

1. 类型不同

char 是字符型,byte 是字节型

2. 范围不同

char与BYTE都是占一个字节,但char是有符号的,BYTE是无符号的,占用空间一样大,只是它们各自能表示数的范围不同而已:

char: -127----+128之间(ANSI)
unsigned char: 0-255之间(ANSI)

3. 强制类型转换

byte可以直接强制转成char,如:

BYTE* p;char* s = (char*)p;

转载地址:http://yloen.baihongyu.com/

你可能感兴趣的文章
Python Singleton
查看>>
Python hashmap
查看>>
python 切片
查看>>
interview sum
查看>>
HTTPs Control
查看>>
澳洲孕维生素
查看>>
Prenatal Vitamin Brands
查看>>
has_key or in
查看>>
Python sort list customisation
查看>>
Python sort dict by value
查看>>
Python collections deque - double-ended queue ()
查看>>
Python sort sorted OrderDict
查看>>
Python dict sort
查看>>
Python lambda
查看>>
Python modify string in place
查看>>
Python dict del
查看>>
Http header
查看>>
HTTP Header
查看>>
ASCII - American Standard Code for Information Interchange
查看>>
进制转换
查看>>