stats.h文件中的代码:
#ifndef C_STATS_H#define C_STATS_H
#include <stddef.h>
/** Read doubles from stdin and calculate statistics on them.* Reading terminates after enough values have been read or when reading a value fails.* If no values are read, nothing is returned via min/max.* @param count pass-by-pointer: input max amount of values to read, output actual count of values read, cannot be NULL* @param min pass-by-pointer: input none, output min value, nothing if NULL* @param max pass-by-pointer: input none, output max value, nothing if NULL* @param sum pass-by-pointer: input old sum, output updated sum, nothing if NULL* @return the last value read successfully (0.0 if no values were read)**/
double stats(size_t* count, double* min, double* max, double* sum);#endif---------------------------------
pointerFun.h中的代码:
#ifndef C_POINTERFUN_H#define C_POINTERFUN_H
/** Set values by pointers* If x and y point to the same variable, output value 42 * 13 to it, otherwise:* @param x pass-by-pointer: output value 42* @param y pass-by-pointer: output value 13**/void pointerfun( double* x, double* y);
#endif-------------------------
已给程序:
• stats.h 
• pointerFun.h
需要完成并提交的程序:
• stats.c 
• pointerFun.c 
• pointerFun.h 
• main.c
1. 完成函数pointerFun(顾名思义,指针函数),该函数需有两个整型参数(x and y, in this order)且没有返回值. 要求完成的功能在pointerFun.h有详细描述。注意在文件头需进行正确的函数声明。
2.按照stats.h 中的要求完成stats.c文件
3. 写出测试程序main.c以测试你的程序是否正确。
注意:
• pointerFun部分占成绩的20%,main 部分占%5, stats部分占75%。
• 这里考察的是将指针作为函数参数问题。