I'm new in C programming. I want to scan some names and then put them in an array only if this name does not already exists and if it doesn't put this name in an empty cell. Here is the code that I wrote but when it comes to the if statement the systems crashes.
char sing_in[100];
char username[20];
char *x1[2];
int z;
for(z=0; z<2; z++)
{
printf("dwse to username\n");
scanf(" %s", &username);
if (strcmp(username,sing_in[z]) == 0 )
{
printf("this username already exists\n");
}
else if( sing_in[z] == 0)
{
*x1[z] = username;
*x1[z] = sing_in[z];
printf("new username added\n");
}
}