window stop working

Can help me to find problem with this code?
this is the segment code but this is the problem because went i delete this, my program works properly but the validation is in this segment code. when i run my program, a popup window said that the program had stopped.

noted that my program don't have any syntax error.

here are the segment code:


FILE *tenant;
tenant=fopen("tenant.txt","r+");
if(tenant==NULL)
{
printf("\n Can not open file!!");
exit(0);
}
else
{
fseek(tenant,0,SEEK_SET);
while(fscanf(tenant,"%s %s %s %d %s %s %s %s",&username,password,name,age,gender,email,phone,occupation)!=EOF)
{
if(strcmp(username,member_username)==0 && strcmp(password,member_password)==0)
{
gotoxy(5,30);
printf("You have successfully Login");
sleep(3);
getch();
break;
}
}
fclose(tenant);
}
Last edited on
&username

If username is a char-pointer or a char array, that looks wrong.
Topic archived. No new replies allowed.