|

楼主 |
发表于 2021-8-15 17:26:26
|
显示全部楼层
#include <stdio.h>
double *search(double(*pointer)[4],int n);
void main()
{
double score[][4] = {{60.0, 70.0, 80.5, 90.5},{56.0, 89.0, 67.0, 88.0},{64.2, 78.5,90.5,80.5}};
double *p;
int i,m;
printf("please enter the number of student; ");
scanf("%d",&m);
printf("the scores of no.%d are:\n",m);
p = search(score,m);
for( i=0; i < 4; i++)
{
printf("%f\t",*(p + i)); // \t为水平制表符 相当于键盘上的tab键
}
printf("\n");
}
double *search(double (*pointer)[4], int n)
{
double *pt;
pt = *(pointer + n);
return pt;
}
这个是代码
|
|