So I have an assignment for hs and honestly I do not know how to program in C so I would appreciate all the help I can get.
Anyways my problem is that I cannot for the life of me read a content of a file, asign it to a variable and compare it to another variable if the content is the same.
I am making a login interface with already pre-input admin email and admin password and here is my mess of a code for now:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *emailf;
emailf = fopen("email.txt", "r");
char* fgets(char* emailx){
return emailx;
}
fclose(emailf);
char email [30];
char password [16];
do{
printf("E-mail:");
scanf("%c", &email);
}
while (email != emailx);
What it does is tells me that emailx variable is not even declared so if you could help me I would be glad! And also it does not have to resemble this code since I do not know jack crap about C programming language so if you could tell me a different way to try what I am trying would be good as well. Thank you!