用指针实现整型数据的加法

#include <stdio.h>
int *add(int a,int b)
{
 int c = 0;     //原题没有这行
 int *p = NULL;
 p = &c;        //原题没有这行
 *p = a+b;
 return p;
}
int main(void)
{
 printf("%d/n",*add(2,3));
    return 0;
}
posted @ 2012-09-09 14:21  byfei  阅读(313)  评论(0编辑  收藏  举报