hi...i recently given sort of assignment for matching.Code:#include <stdio.h> #include <io.h> #define NULL 0 #define EOF (-1) main() { char pw[4]; char c; FILE *fp, *fopen(); fp=fopen("c:\\password.txt","rb"); if(fp==NULL) { printf("can not open file\n\n"); getchar(); exit(); } while((c=fgetc(fp))!=(EOF)) { /* printf("found\n"); */ printf("%c", c); getchar(); } fclose(fp); getchar(); }
but i facing problem for stopping.
As i use getchar() to troubleshoot, instead i can read the password.txt
but read with never ending...can someone enlighten me plz..?