指针之美,不做解释,细心感受
#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]