用指针函数输出学生成绩
2015-11-30 20:58
387 查看
#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; }
相关文章推荐
- 【学习总结】【多线程】 安全隐患 & 通讯 & 线程的状态
- LeetCode_Jump Game
- 浅谈熵与贝叶斯
- string、vector
- HDOJ 1000 java版
- homerHEVC代码阅读(11)——基础结构之output_set_t、video_frame_t
- C语言精华代码
- 寻找相同元素的指针
- android H264码流中的SPS获取
- 数据结构例程——归并排序
- android开发技巧总结(68个常用用法)
- Web Services 指南之:Web Services 的特性
- Web Services 指南之:Web Services 的特性
- iOS后台运行
- 懒加载的动态数组添加object需要self. 不能使用_
- 【Android】自定义View
- [LeetCode]题解(python):064-Minimum Path Sum
- Hadoop-MapReduce初步应用-统计单词个数
- Android项目——ListView的使用
- 1036. Boys vs Girls (25)