大可爱 发表于 2018-10-8 18:08:46

指针之美,不做解释,细心感受

#include<stdio.h>
#include<malloc.h>
int a = {1,2,3,4,5,6,7,8,9,},*p;
void f(int *s,int b[])
{
        *s = b;
}
void main()
{
        p = (int*)malloc(sizeof(int));
        f(p,a);
        printf("%d\n",*p);
}
#include<stdio.h>
#include<malloc.h>

void f(int *s,int b[])
{
        *s = b;
}
void main()
{        int a = {1,2,3,4,5,6,7,8,9,},*p;
        p = (int*)malloc(sizeof(int));
        f(p,a);
        printf("%d\n",*p);
}


页: [1]
查看完整版本: 指针之美,不做解释,细心感受