摘要:
一、函数默认参数 #include <iostream> using namespace std; //函数默认参数 //如果我们自己传入了数据,就用自己的数据,如果没有,那么就用默认值。 //语法: 返回值类型 函数名( 形参 = 默认值 ) int func(int a, int b = 2 阅读全文
摘要:
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;//指针的指向可以修改,但是指针指向的值不可改, / 阅读全文