《C语言程序设计》上机实验六 指针 参考答案

标签:
教育 |
//《C程序设计》 上机实验指导 P45
//二、1.编写程序:完成函数void my_power(double x,int y,double *mypow)的定义,该函数的功能是:求x^y存入指针变量mypow所指向的存贮单元中,并编写主程序,验证my_power()的有效性。
#include <stdio.h>
#include <math.h>
void my_power(double x, int y,double *mypow)
{
}
main()
{
}
//二、2.编写程序:完成函数int absmin(int *a,int n)的定义,它能实现求指针a所指向的前n个整数中绝对值最小的数,并将它返回给主调函数;并编写程序,验证absmin()的有效性。
#include <stdio.h>
#include <math.h>
#define N 3
int absmin(int *a,int n)
{
}
main()
{
}
//二、3.编写程序:从键盘任意输入一个字符串,输出该字符串。然后,将该字符串逆序存放后再输出,要求用字符指针完成。
#include <stdio.h>
#include <string.h>
#define N 50
void invstr(char *s)
{
}
main()
{
}
http://s8/middle/5f2925ff487df287d6ab7&690指针