FAQ > How do I... (Level 1) > Get a line of text from the user/keyboard (C)
FAQ > Explanations of... > Why it's bad to use feof() to control a loop
Why binary mode for strings? If you really need binary mode, shouldn't you use fread instead of fgets?
Do you really need clrscr and conio.h?
[edit]
Code:
fgets(temp_user,sizeof(user)+1,login);
Read one less than the string can hold (even when accounting for the null character), but disguise it to look like it's reading one more than it should?
Kinda the same thing here:
Code:
scanf("%15s", user);
What's \i?
Code:
else printf("\incorrect\n");
Is login a FILE* or a function?
Code:
int login(void){
char user[15];
char pass[15];
char temp_user[17];
char temp_pass[17];
int sw_ok=1;
FILE *login;