摘要: 点击查看代码 #include<iostream> #include<string> using namespace std; //创建一个 自定义的数据类型 //语法:struct 类型名称 { 成员列表 }; struct Student { //成员列表 string name; int ag 阅读全文
posted @ 2021-08-02 19:58 毋纵年华 阅读(356) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> #include<string> using namespace std; int main(){ int arr[10] = { 1,2,3,4,5,6,7,8,9,10 }; cout << "第一个元素arr[0]是:" << arr[0] 阅读全文
posted @ 2021-08-02 19:36 毋纵年华 阅读(25) 评论(0) 推荐(0)
摘要: 技巧:看const右侧紧跟着的是指针还是常量,是指针就是常量指针,是常量就是指针常量。 const修饰指针 —— 常量指针 点击查看代码 #include<iostream> #include<string> using namespace std; int main(){ int a = 10; 阅读全文
posted @ 2021-08-02 19:05 毋纵年华 阅读(33) 评论(0) 推荐(0)