您当前的位置:首页 > 计算机 > 编程开发 > C语言

C 中的数据类型

时间:12-14来源:作者:点击数:

数据类型指定变量可以存储的数据类型,例如整数,浮点数,字符等。

有以下 C 语言数据类型。

Types Data Types
Basic Data Type int, char, float, double
Derived Data Type array, pointer, structure, union
Enumeration Data Type enum
Void Data Type void
基本数据类型

基本数据类型是基于整数和基于浮点的。 C 语言支持有符号和无符号字面量。

基本数据类型的内存大小可能会根据 32 或 64 位操作系统而变化。

让我们看一下基本数据类型。它的大小根据 32 位体系结构给出。

Data Types Memory Size Range
char 1 byte −128 to 127
signed char 1 byte −128 to 127
unsigned char 1 byte 0 to 255
short 2 byte −32,768 to 32,767
signed short 2 byte −32,768 to 32,767
unsigned short 2 byte 0 to 65,535
int 2 byte −32,768 to 32,767
signed int 2 byte −32,768 to 32,767
unsigned int 2 byte 0 to 65,535
short int 2 byte −32,768 to 32,767
signed short int 2 byte −32,768 to 32,767
unsigned short int 2 byte 0 to 65,535
long int 4 byte -2,147,483,648 to 2,147,483,647
signed long int 4 byte -2,147,483,648 to 2,147,483,647
unsigned long int 4 byte 0 to 4,294,967,295
float 4 byte  
double 8 byte  
long double 10 byte  
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门
本栏推荐