c-45 用指针 做 函数的 参数 和返回值

#include <stdio.h>
#include <math.h>

//求N次方的值
int* function1(int *p,int index)
{
 *p = pow(*p, index);
 return p;
}


int main(int argc, char* argv[])
{
//用指针 做函数的 参数  和返回值

 int i = 1;
 int *p = &i;


 p=function1(p, 4);
 printf("%d ", *p);
 getchar();
 return 0;

}

posted @ 2018-06-23 00:29  zhumoerju  阅读(128)  评论(0编辑  收藏  举报