You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
358 B

2 years ago
//6.2.4数组形参.cpp
#include <iostream>
using namespace std;
void ra(const int *a);
void rb(int *(&a));
int main(){
int a[]={1,2,3,45,6,7,8,9,5,15,21,11};
for (auto i=begin(a);i!=end(a);i++)cout << i <<endl;
ra(a);
return 0;
}
void ra(const int *a){
cout << *a << endl;
}
void rb(int *(&a)){
// if(begin(a)!=end(a)){
// begin(a)=12;
// }
}