[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C programming

On Fri, 4 Aug 2000, John Reinke <jmreinke@falcon.cc.ukans.edu> wrote:
> 1) This is NOT for a programming assignment. ;-)

Ho, no!  :-)  These are just some experiments.

> 2) Using the comma within a condition is treated as AND (&&). That's
> messier code than I usually create.

Well, this is uncorrect.  Execute

  int i;
  for(i=1; 0, i <10; i++)
    printf("%i\n", i);

ANSI C states:

	A pair of expressions separated by a coma is evaluated left to
	right, and the value of the left expression is discarded.

Thanks for taking the time to reply,

Reply to: