ogr.txtCode:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <ctype.h> #include <time.h> #include <sys/types.h> char *password; char *username; char *path; char usernameLogin; char passwordLogin; int main ( void ) { static const char filename[] = "ogr.txt"; FILE *file = fopen ( filename, "r" ); int i, j; char arra[128][128]; char line[128]; for(i=0; i<128; i++) for(j=0; j<128; j++) arra[i][j] = '\0'; for(i=0; i<128; i++) line[i] = '\0'; if ( file != NULL ) { i=0; while ( fgets ( line, sizeof line, file ) != NULL ) { strcpy(arra[i], line); i++; username = arra[0]; password = arra[1]; path = arra[2]; } // printf("username=%s password=%s path=%s ", username,password,path); printf("type username :"); scanf("%s",&usernameLogin); printf("\n"); printf("type password :"); scanf("%s",&passwordLogin); printf("\n"); if(usernameLogin==username && passwordLogin==password) { printf("Correct!"); } else { printf("Wrong!"); } fclose ( file ); } else { perror ( filename ); } return 0; }
these are pointers which is getting the values from fileCode:20009874 //uname 9874 /pword desktop //path
username = arra[0];
password = arra[1];
path = arra[2];
but usernameLogin and passwordLogin are not pointer
if(usernameLogin==username && passwordLogin==password)
{
printf("Correct!");
}
else
{
printf("Wrong!");
}
how can I compare the pointer and normal variable ?
I want to make read from file and login!



but :s