mitek mailed my dodgeit address and I happenned to look at it
<http://www.dodgeit.com/run/checkmail?mailbox=hexkid>
Please don't followup on usenet articles by email.
Many people use an invalid address and your question will never be seen
by them; also questions and answers on usenet will be reviewed by
several people, and mistakes are much more likely to be caught.
mitek777@o2.pl e-mailed:[color=blue]
> Pedro Graca wrote:[color=green]
>> Here you are comparing what you read from the file with the contents
>> of the name array.
>> The array has "kate";
>> whatever you read from file will have a trailing '\n' and cannot ever
>> be equal to "kate".
>>
>> So, before comparing the strings, remove the terminating newline from
>> s.[/color]
>
> How can I do that?[/color]
use strlen() function te determine where is the last character of the
string read from the file
size_t len = strlen(s);
if s is "kate\n", len will be 5, and s[4] is the terminating newline
if ((len > 0) && (s[len-1]) == '\n') {
/* just delete the newline and update len */
s[len-1] = 0;
len -= 1; /* or s[--len] = 0 */
}
--
If you're posting through Google read <http://cfaj.freeshell.org/google>