comp.lang.c
[Top] [All Lists]

Re: ?: as an lvalue

Subject: Re: ?: as an lvalue
From: Richard
Date: Mon, 31 Mar 2008 21:21:00 +0200
Newsgroups: comp.lang.c

richard@xxxxxxxxxxxxxxx (Richard Tobin) writes:

> In article <fsrc0v$4ov$3@xxxxxxxxxxxxxxxxxxxxxxxxx>,
> Richard  <devr_@xxxxxxxxx> wrote:
>
>>> I mean I'm OK personally with the way it works in C. I just like to
>>> know what is it exactly in '(c?x:y)=v' that triggers a "I don't really
>>> know what to say" reaction from some people.
>
>>because its not a macro? it returns a value. I dont know the legalise
>>words but it seems "obvious" enough to me, but again it might be because
>>I am tainted.
>
> Some other languages allow this.  For example, I think Algol 68 allows
>
>   IF a THEN b ELSE c FI := d;
>
> In C the number of contexts where an lvalue doesn't decay into an rvalue
> is very small, but I don't see anything inherently un-C-like about this
> case.
>
> -- Richard

And he can do it in C using pointers and *. I dont see  the problem or
the confusion here as far as the C language goes to be honest.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy