string contents into structure help
I have this problem where I want a persons name to be put into a structure. I have written the code like this but my compiler is telling me "Lvalue" is required. I dont know how to rectify this, can anyone tell me what I've done wrong?? Thanks in advance.
Code:
typedef struct
{
char name[40];
} details_t;
int main (void)
{
details_t person;
char name [40];
printf("\nPlease enter the persons name: ");
fflush(stdin);
gets(name);
name = person.name;
fflush(stdin);
getc(stdin);
return 0;
}