I want to say thank you to many of you...
such as elycia and matxp and most of you who help me in my programming. i managed to completed it and solve almost all problems.
thanks guys...
i...
Type: Posts; User: frodonet
I want to say thank you to many of you...
such as elycia and matxp and most of you who help me in my programming. i managed to completed it and solve almost all problems.
thanks guys...
i...
fin = fopen("C:\\LANVIN.TXT", "r");
while( fgets(line_buffer,sizeof(line_buffer),fin) != NULL )
{
sscanf(line_buffer,"%s %s %s...
i did this and doesn't work why....
......
checkpw();
......
Hi Guys,
so sorry to create a new thread.
But just wondering...
how do i create a function of checkpw() with this bunch of codes...
in which part i don tell the compiler to quit???
ok i have remove the new line though...
but after scanf...it seems it still close the program...i don know why....
argghhghghgh
hahah...i remove the '&' and the output came correct, one question though...
why i did a printf on my password entered...it has a coma in front it? why?
but earlier before i do scanf i have put these command.
fpassword = fopen("C:\\PASSWD.TXT", "r");
if (fpassword == NULL) printf("File doesn't exist\n");
but if it can't open in the first...
while( fgets(line_buffer,sizeof(line_buffer),fpassword) != NULL ) /* read from file while still data available */
{
char ftemp[20], fpass[20], fuser[20];
...
Guys, this is the latest development i did on my program.
i compiled it in bloodshed C++..no warnings or whatsoever...
but still the line buffer has more than 3 fields...which i think causing...
how to add a debug print? can show me how?
i don know....when i compile there are no errors or warnings.
now added string.h already, the problem still persist...
it seems the linebuffer parsing more than 3 fields....i don know why is...
i don understand one thing...
since i declared the array size of the inputted user name is the same as the username inside the file...would that be a problem why would i need BUFSIZE?
i would appreciate an example...a simple one. there's no way a beginner can understand a c code just by sentences.
so how do i use it to check name and password?? :confused:
checking the name and password inputted or checking name and password with the file?
any examples?? this BUFSIZ is really new to me... :confused:
i have changed my pass[5] into pass[20]...
how do i do this??? how to validate??
#include<stdio.h>
main( )
{
FILE *fpassword;
char c, line_buffer[100], user[20], pass[5];
fpassword = fopen("C:\\PASSWD.TXT", "r");
if (fpassword == NULL) printf("File...
i have put breaks...it still the same thing....:rolleyes:
sorry to made you so mad.
it's just that i'm kind of dumb. please forgive me, i knew i asked so many questions.
so sorry...
what should i declare x and y and i??
eh...the problem still persist :(
The loop is reading the data from the file....but i don think it's looping cause i have entered the user id and password before the loop...
so then the loop can check one time for the user ...:p ...
ehh...kind of weird,
when i put a printf("username not found") outside the loop, it seems whether i entered the correct username/password or false one, it still shows username not found.
but...
i mean if i type in the correct/false user id and password...
it should show "User Authorized/User not authorized"...but it's not showing at all...it's just close the program...
have done 2...