摘要:
#includeusing namespace std;/* 函数定义5个要点: 返回值类型 函数名 参数列表 函数体语句 return表达式 返回值类型 函数名(参数列表){ 函数体语句 ... 阅读全文
posted @ 2021-03-09 20:50
yub4by
阅读(32)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;/* 综合案例:指针+数组+函数 封装一个函数,利用冒泡排序,实现对整型数组的升序排列*/void bubble_sort(int * arr, int len){ // 形参指针arr接收数... 阅读全文
posted @ 2021-03-09 20:41
yub4by
阅读(23)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;void swap1(int a, int b){ int temp = a; a = b; b = temp; cout << "swap1 a=" << a << endl; ... 阅读全文
posted @ 2021-03-09 20:39
yub4by
阅读(21)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;int main(){ /* 指针的定义和使用 */ int a = 10; //定义指针:数据类型 * 指针变量名 int * p; //让指针记录变量... 阅读全文
posted @ 2021-03-09 20:36
yub4by
阅读(34)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;int main(){ /* 指针和数组 */ int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; cout << "数组第... 阅读全文
posted @ 2021-03-09 19:57
yub4by
阅读(21)
评论(0)
推荐(0)