Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Lashchev, Yan
- //CS50(3597)
- //Assignment 11
- //Files.c
- #include <stdio.h>
- #include <stdlib.h>
- int main(void)
- {
- FILE *fpName, *fpPass;
- char *isName, *isPass;
- char user[100], pass[100];
- fpName = fopen("usernames.txt","r");
- fpPass = fopen("passwords.txt","r");
- if (fpName==NULL || fpPass==NULL)
- {
- printf("Username or Password File Cannot Found\n");
- exit(0);
- } else do {
- while ((isName = fgets(user, 100, fpName)) != NULL &&
- user[0] == '\n')
- continue;
- while ((isPass = fgets(pass, 100, fpPass)) != NULL &&
- pass[0] == '\n')
- continue;
- if (isName && isPass) {
- printf("Username: %s", user);
- printf("Password: %s\n", pass);
- }
- } while (isName && isPass);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement