跳到主要内容

C语言数据类型

基本数据类型

整数类型

  • int - 整数
  • short - 短整数
  • long - 长整数
  • char - 字符

浮点类型

  • float - 单精度浮点数
  • double - 双精度浮点数

示例

int number = 42;
float price = 3.14;
char letter = 'A';