用指针函数输出学生成绩

来源:互联网 发布:梅西数据统计 编辑:程序博客网 时间:2024/05/14 11:55
#include<stdio.h>float *search(float(*p)[4],int n){float *pt;pt=*(p+n);return (pt);}int main(){float score[][4]={{1,2,3,4},{2,3,4,5},{3,4,5,6},{4,5,6,7}};float *p;int k,i;printf("enter the student's number you want to search:\n");scanf("%d",&k);printf("This student's scores are:\n");p=search(score,k);for(i=0;i<4;i++){printf("%4.1f ",*(p+i));}printf("\n");return 0;}

0 0
原创粉丝点击