一、运行结果;
二、源代码;
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>
//创建打印二维数组的函数;
void print(int(*p)[5],int r, int c)
{
//初始化变量值;
int i = 0;
int j = 0;
//循环打印二维数组;
for (i = 0; i < r; i++)
{
//内层循环列;
for (j = 0; j < c; j++)
{
//打印结果;
printf("%d ", p[i][j]);
}
//每打印一行换行;
printf("\n");
}
}
int main()
{
//初始化变量值;
int arr[3][5] = { 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7 };
//调用打印二维数组的函数;
print(arr, 3, 5);
return 0;
}