1. 数据类型

1.1 sizeof关键字

sizeof(数据类型/变量)

1.2 实型(浮点型)

单精度 float 4字节 7位有效数字双精度 double 8字节 15-16位有效数字float a = 3.14f;double b = 3.14;科学计数法float f1 = 3e2;

1.3 字符型

char ch = 'a';

1.4 字符串型

C风格字符串 char str1[] = "hello world";string str2 = "helloworld"; 要包含头文件 #include < string >

1.5 数据的输入

cin>>a;


1. 数据类型
http://binbo-zappy.github.io/2024/11/27/cpp/1-数据类型/
作者
Binbo
发布于
2024年11月27日
许可协议