char/unsigned char/int/short 存储范围
Posted z45281625
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了char/unsigned char/int/short 存储范围相关的知识,希望对你有一定的参考价值。
Type | Storage size | Value range |
---|---|---|
char | 1 byte | -128 to 127 or 0 to 255 |
unsigned char | 1 byte | 0 to 255 |
signed char | 1 byte | -128 to 127 |
int | 2 or 4 bytes | -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647 |
unsigned int | 2 or 4 bytes | 0 to 65,535 or 0 to 4,294,967,295 |
short | 2 bytes | -32,768 to 32,767 |
unsigned short | 2 bytes | 0 to 65,535 |
long | 4 bytes | -2,147,483,648 to 2,147,483,647 |
unsigned long | 4 bytes | 0 to 4,294,967,295 |
以上是关于char/unsigned char/int/short 存储范围的主要内容,如果未能解决你的问题,请参考以下文章