httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Re: [apreq-2] conditionals
Date Sat, 19 Apr 2003 22:38:43 GMT
On 19 Apr 2003, Joe Schaefer wrote:

> Randy Kobes <randy@theoryx5.uwinnipeg.ca> writes:
> [...]
> 
> > -    (parent >= 0) ? parent[o].tree[LR(pivot)] : *root = child;
> > +    (parent >= 0) ? parent[o].tree[LR(pivot)] : (*root = child);
> 
> Those aren't equivalent.  The first one uses ?: to select the 
> lvalue - IOW it's doing this
> 
>   ( parent >= 0 ? parent[o].tree[LR(pivot)] : *root ) = child;
> 
> or at least it should be, since that's what I want to have 
> happen here.

Ah - thanks for pointing that out. The error I'm getting with
something like
    (a > 0) ? c : d = 3;
or
    (a > 0 ? c : d) = 3;
is
   '=' : left operand must be l-value
What does work is 
    (a > 0) ? (c=3) : (d=3);


-- 
best regards,
randy kobes


Mime
View raw message