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

    技术2022-05-19  30

    也是一个面试题 不过是找错误的

    这里给出正确的源码

    #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; }


    最新回复(0)