comma operator

Steven Weintraub stevenw at oakhill.UUCP
Tue Aug 15 00:24:10 AEST 1989


After careful thought I have found another place I use the comma operator.

It is in a while statement when I am reading a line.  I use:

while ((ch = getchar()), ch != EOF && ch != '\n')

Although I have never been quite satisfied with this, I have never found
a structure that does this which I find more satisfying.  Any comments
from the peanut gallery?

                   enough from this mooncalf - Steven
----------------------------------------------------------------------------
These opinions aren't necessarily Motorola's or Remora's - but I'd like to
think we share some common views.
----------------------------------------------------------------------------
Steven R Weintraub                             | O Lord,
...!cs.utexas.edu!oakhill!stevenw              |   let me talk gently,
Motorola Inc.  Austin, Texas                   | for I might have to eat my
(512) 891-3023 (office) (512) 453-6953 (home)  |   words tomorrow.
----------------------------------------------------------------------------



More information about the Comp.lang.c mailing list