#include <stdio.h>
#include <stdlib.h>
struct ss_s{
int a;
int b;
char *c;
int arr[3];
int *d;
};
int main(void)
{
struct ss_s tt, tmp;
int q = 9, i;
tt.a = 10;
tt.b = 1000;
tt.c = "abc";
tt.d = &q;
tt.arr[0] = 1;
tt.arr[1] = 2;
tt.arr[2] = 3;
tmp = tt;
printf("%d %d %s %d\n", tmp.a, tmp.b, tmp.c, *tmp.d);
for(i = 0; i < 3; i++) {
printf("tmp.arr[%d] = %d\n", i, tmp.arr[i]);
}
return 0;
}
c-free运行结果
10 1000 abc 9
tmp.arr[0] = 1
tmp.arr[1] = 2
tmp.arr[2] = 3