comma operator

CCEL ccel at chance.uucp
Sat Aug 12 03:10:07 AEST 1989


>I have also written code something like this:
>
>linked_list_node_t *p;
>if ( p && ( p = p->next, p ) )
>	/* something */

I've never seen this format, how does exactly does this work?

>No doubt there are other ways to do it, but I don't see this as a sin.

Wouldn't this produce the same result:

if (p && ( p = p->next ) )

??
Randy Tidd                   MITRE-McLean CCEL Lab
rtidd at mitre.arpa             ccel%community-chest at gateway.mitre.org
#define DISCLAIM TRUE



More information about the Comp.lang.c mailing list