2
int a,b;
...
((a>b) ? a : b) = value ;

This is error in c.

lvalue required for assigning value.

But This works fine in c++.

Why not in c and in c++? whats the difference? whats happening? i know that it returns lvalue in c thats why error. fine. But why it is so in c and c++ allowed it by returning rvalue?

Dineshkumar
  • 4,165
  • 5
  • 29
  • 43
  • 1
    Take a loot at this. http://stackoverflow.com/questions/8535226/return-type-of-ternary-conditional-operator – olevegard May 07 '13 at 12:37

0 Answers0