谭浩强经典C语言学习课件09 指针.ppt

谭浩强经典C语言学习课件09 指针

9.6 返回指针值的函数 函数定义形式: 类型标识符 *函数名(参数表); 例 int *f(int x, int y) 例9.25 指针函数实现:有若干学生成绩,要求输入学生序号后, 能输出其全部成绩 main() { float score[][4]={{60,70,80,90}, {56,89,67,88},{34,78,90,66}}; float *search(float (*pointer)[4],int n); float * p;int i,m; printf(Enter the number of student:); scanf(%d,m); printf(The scores of No.%d are:\n,m); p=search(score,m); for(i=0;i4;i++) printf(%5.2f\t,*(p+i)); } float *search(float (*pointer)[4], int n) { float *pt; pt=*(pointer+n); return(pt); } pointer pointer+1 34 78

文档评论(0)

1亿VIP精品文档

相关文档