那我要是这样改的话应该也可以的吧,但是运行时有问题了
#include<stdio.h>
#include<string.h>
typedef struct
{
char name[200];
}st;
void main()
{
char *name;
st student;
gets(name);
strcpy(student.name,name);
puts(student.name);
}
#include<stdio.h>
#include<string.h>
typedef struct
{
char name[200];
}st;
void main()
{
char *name;
st student;
gets(name);
strcpy(student.name,name);
puts(student.name);
}