Re: Learning C with Older books ?.

From: Michael Wojcik (mwojcik_at_newsguy.com)
Date: 12/17/04


Date: 17 Dec 2004 17:00:06 GMT


In article <cpsr24$r8q$1@reader1.imaginet.fr>, "Charlie Gordon" <news@chqrlie.org> writes:
> "Lawrence Kirby" <lknews@netactive.co.uk> wrote in message
> news:pan.2004.12.16.14.05.20.500000@netactive.co.uk...
> >
> > for (size_t i = sizeof x; i != 0; ) {
> > i--;
> > ...
> > }
>
> i > 0 works as well and is more natural.

Where in nature does "i > 0" occur?

You may prefer it, but it is nothing more than a preference. Spare
us the bogus claims about what is "natural" C syntax.

Personally, I'd be just as happy with a plain "i" for the second "for"
expression. I know what it means; any competent C programmer knows
what it means; someone learning C either knows what it means or needs
to learn; no one else should be reading the code.

-- 
Michael Wojcik                  michael.wojcik@microfocus.com
Not the author (with K.Ravichandran and T.Rick Fletcher) of "Mode specific
chemistry of HS + N{_2}O(n,1,0) using stimulated Raman excitation".


Relevant Pages

  • Re: A basic question on asm
    ... > down to a matter of preference. ... At&t syntax looks better on an architecture where you could write: ... On the original architecture, it was more elegant. ... Most of us would like an assembler with this syntax, ...
    (comp.lang.asm.x86)
  • Re: How do I declare and fill this array?
    ... If adding part of the variable's type definition onto the variable name is a good idea then clearly syntax such as the following would tell us that MyObject is a reference "before" having to see what it is a reference to. ... I believe that the "trivial argument" is only my personal preference and that others may have different preferences. ... The "One is correct and the other isn't:)" quote was written by "Ray Cassick" ...
    (microsoft.public.dotnet.languages.vb)
  • Re: RAID config for SBS 2k3 R2
    ... I'm inclined to agree, mirrored system, RAID 5 Data is my usual practice of ... preference). ... Others would use 5 in RAID5 with one hot spare. ... Gregg Hill ...
    (microsoft.public.windows.server.sbs)
  • Re: Sumproduct(N and --
    ... Not going to try and answer for Harlan, but it's not so much a preference as ... the x*x syntax will fall over. ... Wonder if Harlan has a preference. ... This is necessary because SUMPRODUCT skips anything other than numbers. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: It was Twenty Years Ago Today...
    ... Bob Butler wrote: ... > My preference would be to have no default and to require the "(x To ... > y)" syntax for all declarations. ...
    (microsoft.public.vb.general.discussion)