compare character array with file in C
-
i have a character array such that char buffer[]= "bob 12345" and text file has the data bob 12345 mike abcde easton 9999 now i want to compare the array with the file line by line and find whether a valid combination of usernames and passwords exist.... please help
-
i have a character array such that char buffer[]= "bob 12345" and text file has the data bob 12345 mike abcde easton 9999 now i want to compare the array with the file line by line and find whether a valid combination of usernames and passwords exist.... please help
Read the file line by line (
fgets
) and compare with buffer (strcmp
).«_Superman_» _I love work. It gives me something to do between weekends.
-
i have a character array such that char buffer[]= "bob 12345" and text file has the data bob 12345 mike abcde easton 9999 now i want to compare the array with the file line by line and find whether a valid combination of usernames and passwords exist.... please help
Didn't you just ask this question here? So which part exactly are you needing help with? Iterating a file, text comparison, or something else?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Didn't you just ask this question here? So which part exactly are you needing help with? Iterating a file, text comparison, or something else?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous