M
Meenu
Are the two statements same:
a<=20?b=30:c=30;
(a<=20)?b=30:c=30;
a<=20?b=30:c=30;
(a<=20)?b=30:c=30;
Meenu said:Are the two statements same:
a<=20?b=30:c=30;
(a<=20)?b=30:c=30;
Ian said:Google "C++ operator precedence"
(yes, unless you have some funny #define going round)
Ian said:Google "C++ operator precedence"
Ian said:Oops, wrong ng. Obviously that says 'c operator precedence'
I didn't get it...
pls elaborate
Are the two statements same:
a<=20?b=30:c=30;
(a<=20)?b=30:c=30;
Simon said:How's the homework going? Obviously not very well if you still haven't
grasped basic operator precedence. May I suggest reading a book or
actually attending class?
> Are the two statements same:
> a<=20?b=30:c=30;
> (a<=20)?b=30:c=30;
Meenu said:Are the two statements same:
a<=20?b=30:c=30;
(a<=20)?b=30:c=30;
Ian Malone said:Incidentally, since the ternary operator is meant to
return a value, the assignments need to be parenthesised,
since they have a lower priority (they are statements to
be evaluated). You need
a<=20?(b=30)c=30);
CBFalconer said:I wouldn't even bother to read them. They are infested with blank
elidation.
Eric said:The word you seek is "elision." As in "The Elision Fields,"
where one forgets one's past lives -- Egad! I'm turning Buddhist.
(Interesting thought: How can something be "infested with"
an absence? Maybe I'd understand better if I were infested
with an absinthe ...)
Meenu said:Are the two statements same:
a<=20?b=30:c=30;
(a<=20)?b=30:c=30;
No. In fact both will generate compilation error.
The word you seek is "elision." As in "The Elision Fields,"
where one forgets one's past lives -- Egad! I'm turning Buddhist.
(Interesting thought: How can something be "infested with"
an absence? Maybe I'd understand better if I were infested
with an absinthe ...)
Chris said:CBFalconer wrote:
The word you seek is "elision." As in "The Elision Fields,"
where one forgets one's past lives -- Egad! I'm turning Buddhist.
elide: omit by elision [Concise OED]. And it was the Elysian Fields,
which were Greek ("The Isles of the Blest"); the Romans later moved
them into the underworld for the Grateful Dead (er, I mean the righteous
dead <g>).
Keith said:Doesn't that make them equivalent?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.