摘要:
1、结构体定义: 结构体属于用户自定义数据类型,允许用户存储不同的数据类型。 语法: struct 结构体名 { 结构体成员列表 }; #include <iostream> #include <string> using namespace std; //1.创建学生数据类型 //学生:姓名、 阅读全文
摘要:
1、指针操作数组 #include <iostream> using namespace std; int main(){ int arr[10] = {1,2,3,4,5,6,7,8,9,10}; cout << "The first element is:" << arr[0] << end 阅读全文
摘要:
1.常量指针(const * ),红色标记不可修改 #include <iostream> using namespace std; int main(){ int a = 20; int b = 10; const int * p = &a;//指针的指向可以修改,但是指针指向的值不可改, / 阅读全文