#include <stdio.h>
#include <string.h>
struct sample
{
int a, b;
char*ch;
};
void fl(struct sample p)
{
p.a += p.b;
p.ch[2] = 'x';
printf("%d,", p.a);
printf("%s\n", p.ch);
}
int main()
{
struct sample samp;
samp.a = 1000;
samp.b = 100;
strcpy(samp.ch, "abcd");
fl(samp);
return 0;
}
报错:samp未初始化。