C++传递数组给函数

通常方法 C++ 传数组给一个函数,能够传数组的首地址和长度:ios #include <iostream> using namespace std; int sum_arr(const int arr[], int n) { int total = 0; for(int i = 0; i < n; i++) { total += arr[i];
相关文章
相关标签/搜索