#include <iostream> void fun(int* a, int num) { for (int i = 0; i < num; ++i) { std::cout << a[i] << " "; } } int main() { int a[5] = {0, 1, 2, 3, 4}; fun(a, 5);//数组名弱化为指针 return 0; }