#include <stdio.h> #include <string.h> main() { FILE *p; char buf_login[10]; char buf_stream[10]; puts("Login:"); scanf("%s",buf_login); printf("Your login is:%s\n", buf_login); p=fopen("12.txt","rt"); fgets(buf_stream, 10, p); fclose(p); if (strcmp(buf_stream,buf_login)==0) { puts("OK"); } else { puts("error!"); } } Cannot pass "authentication". In the file 12.txt , for example, is abcd . I compile, I enter abcd and still throws error! instead of ok. I can not understand where the error. It seems the code is correct. Encoding 12.tht ASCII file. I am writing in Borland 2.0, on a virtual machine on Ubuntu.
{}in the editor). - PinkTux