www.thecareerplus.com
The CareerPlus
Home Technical Resources Programming Expressions
Thursday 09th September 2010
 
 
Does the ?: (ternary operator) return a lvalue? How can I assign a value to the output of the ternary operator?

Discuss it!          


No, it does not return an "lvalue"

Try doing something like this if you want to assign a value to the output of this
operator
*((mycondition) ? &var1 : &var2) = myexpression;

Discuss it!          

CrackTheIntervew.NET
Advertisement
 
Top! Top!