how to create multiple users in c++, taking words from a text file? results when I use only one *to_find*

Asked

Viewed 23 times

0

#include <stdio. h> #include<string. h> typedef struct? char name[20]; int password[8]; } Adm;

int main() { Adm adm 1, adm 2, adm 3, adm 4;

FILE * login;
login = fopen ("Adms.txt" , "r");
char to_find[] = "ana";
char to_find[] = "a123";
char to_find[] = "paulo";
char to_find[] = "p456";

 while ( ! feof (login) )
 {
   if ( fgets (adm1.nome, 10 , login) == NULL ) break;
   fputs (to_find, stdin);
   break;
   
 }

fclose(login);

printf("nome: ");
scanf("%s", adm1.nome);
printf("\nsenha: ");
scanf("%s", adm1.senha);

Return 0; }

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.