All this to avoid using char[20]; (or such) in a struct? Really...
Watch this...
Code:
// the struct
typedef struct t_User
{ char Name1[20];
char Name2[20];
// whatever else you need
} User;
// get names
void GetName(char *Name)
{ printf("Enter your name : ");
scanf("%19s", Name); }
int main (void)
{ User Users;
GetName(Users.Name1);
GetName(Users.Name2);
printf("%s %s\n", Users.Name1,Users.Name2);
return 0; }
See how much easier that is? And it works...
In your code where you have something in a string just use strcpy();
Code:
strcpy(users.name1,NewName);
Over my time dabbling in C I've probably tried a dozen different "bright idea" ways of assigning strings across the equals sign... exactly none of them worked.