# include <stdlib.h> // for exit() # include <stdio.h> // defines FILE //project task //ask for username and password of user. //make 2 array (1 for username, 1 for password) int pp; //global list FILE *fptr; // ptr to file for username char ch; FILE *x; FILE *fptr2; // ptr to file for password char ch2; FILE *z; char theString[] = "First Mid Last"; char theString1[100]; char theString2[100]; char zzzz[100]; char storeuser[100]; //global list int main() { if ((fptr = fopen("username.txt","r"))== NULL ) // open file in writing mode { printf("Can't open file username.txt\n"); getch(); exit(1); // error return value } if ((fptr2 = fopen("password.txt","r"))== NULL ) // open file in writing mode { printf("Can't open file password.txt\n"); getch(); exit(1); // error return value } printf("Enter your userame\n"); scanf("%s", &theString1); // printf("%s", theString1); printf("Enter your password\n"); scanf("%s", &theString2); // printf("%s", theString2); printf("%s", fptr); while ((ch = getc(fptr)) != EOF) printf("%c",ch); fclose(fptr); getch(); return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)