From: peternilsson42 <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, April 16, 2007 4:34:09 PM
Subject: [c-prog] Re: Hexadecimal to Decimal
> 
> 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.

 Thanks for good advice. I'd like to pay attension to the
posting-styles.

> >   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.

 You're right. I haven't noticed this point which might have led
to onerous bugs.

> > 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.

 Yes. It was careless of me not to check if there actually was a '\n'.

> > 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.

 Exactly.


 I now feel it's quite difficult work to write a complete code
taking how several users would use it into considertaions.
I need more precious advice from the old know-it-all as well as
experience of my own.

Thanks all,
Yutaka


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/c-prog/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/c-prog/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to