peter nilsson wrote:

> No, strings are terminated with a null (zero valued) byte, ASCII
> or otherwise.

Sigh.

Yes, of course it's null. And null is 0--ASCII, ANSI, ISO 8859.x, EBCIDIC,
binary, octal, decimal, and hexadecimal.

But consider our audience, which includes a whole lot of beginners and
lower-level students. If I just say 0, will everyone understand it's 0, and
not ASCII 48 ('0')?

I understand you want to be accurate. But please, saying "ASCII 0" is not
wrong--it's just putting it in context I think everybody will understand.
Heck, I bet half our audience doesn't even know that null == 0.

> Well, *s is false, so *s == 0 would be true.

And your point is? I didn't say (*s == 0) is 0. I said "*s == 0, which is
equivalent to false". That's absolutely true. I don't understand what you
think you're correcting.

> No, s and t are always incremented no matter what the condition
> result.

Yes, you're right. I typed faster than I thought there.

> Neither would I, I'd prefer the semicolon on a separate line.

Actually, I think Kernighan and Ritchie do have the semicolon on a separate
line. I remember seeing that and wondering why they did it that way.

> I don't. This loop is idiomatic. It's like saying you don't like
> Aboriginal art because of all the ugly dots. But the dots _are_
> the art. ;-)

Yeah, you're right about that particular piece of code. I would leave it as
it is.

In most cases, however, code absolutely should be written for a coder 3
generations away (or, in my case, so I'll remember next week what I was
trying to do).

There used to be contests to see how complex a piece of code a C coder could
write in one statement. I can't imagine anything much sillier. Contests to
see who could write the clearest code would make much more sense.

Cordially,

Kerry Thompson




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/

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