Hi Guys,
so sorry to create a new thread.
But just wondering...
how do i create a function of checkpw() with this bunch of codes...
Code:
while( fgets(line_buffer,sizeof(line_buffer),fpassword) != NULL ) /* read from file while still data available */
{
char ftemp[20], fpass[20], fuser[20];
sscanf(line_buffer,"%s %s %s",&ftemp,&fpass,&fuser);
if (strcmp(user, fuser) == 0) /* OK, found the username the user inputted */
{
printf("\n\nUsername Correct\n");
if (strcmp(pass, fpass) == 0)
{
printf("User authorized");
getchar();
exit(1);
}
}
}
printf("\n\nInvalid Username or Password");
fclose(fpassword);
getchar();