今天想到一个问题,就是 struct 的传参和数组的传参的区别,先看代码
#include <stdio.h>
#include <string.h>
struct d {
int n;
char str[100];
};
void chg(struct d *a) {
a->n = 1;
strcpy(a->str, "changing");
printf("%dn", a->n);
printf…… 阅读全文
struct 传参改变内容
2