摘要: 运行态、就绪态、阻塞态 创建态、结束态 阅读全文
posted @ 2021-07-22 19:25 毋纵年华 阅读(39) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> #include<string> using namespace std; int main() { //整型 int a = 0; cout << "给整型变量a赋值:" << endl; cin >> a; cout << "a = " << 阅读全文
posted @ 2021-07-22 18:59 毋纵年华 阅读(27) 评论(0) 推荐(0)
摘要: 字符串类型 点击查看代码 int main() { //1、C风格字符串 //注意事项 // char 字符串名 [ ] // 等号后面要用 双引号包含起来字符串 char str[] = "hello"; cout << str << endl; cout << sizeof(str) << en 阅读全文
posted @ 2021-07-22 18:42 毋纵年华 阅读(51) 评论(0) 推荐(0)
摘要: sizeof关键字 实型 有效数字包括小数点以前的数字 float num1 = 3.14 f ; 默认情况下输出一个小数,小数点后最多显示6位有效数字 转义字符 点击查看代码 #include<iostream> #include<string> using namespace std; //转义 阅读全文
posted @ 2021-07-22 17:14 毋纵年华 阅读(285) 评论(0) 推荐(0)
摘要: 常量不可更改 const修饰的变量也称为常量 点击查看代码 #include<iostream> #include<string> using namespace std; //常量的定义方式 // 1、#define宏常量 #define WEEK 7 // 2、const修饰的变量,const修 阅读全文
posted @ 2021-07-22 16:29 毋纵年华 阅读(142) 评论(0) 推荐(0)
摘要: 引用 别名和原名操作同一块内存 引用注意事项 点击查看代码 #include<iostream> #include<string> using namespace std; int main() { int a = 10; //1、引用必须初始化 //int &b; //错误,必须初始化 int & 阅读全文
posted @ 2021-07-22 16:12 毋纵年华 阅读(100) 评论(0) 推荐(0)