Yutaka OKAIE <[EMAIL PROTECTED]> wrote:
>
>  ... Here's the reply for your comments.

Top posting is not recommended. That you felt you needed to put in
that comment only highlights its disadvantages.

>   I think strings obtained with "fgets" end with "\n\0", right ?

No, not necessarily. If the line is longer than the destination
buffer, or if the last line of input is not \n terminated, there
will be no \n in the buffer.

> In order to manipulate the output appearance, I replaced the '\n'
> with '\0',

It's better to use strchr(..., '\n') to find if there actually
was a \n. Then you can use the return pointer to zero it if
needed.

> so there are two '\0's at the end of the string "input".

Technically, there's only ever one null byte in a string. What
follows is not part of that string.

-- 
Peter

Reply via email to