I seem to have figured out that: a < b ? b : a returns a when a < b = false and b when a < b = true but what is the statment: Exp ? Exp : Exp called? Could not find anything describing it in my book Accelerated C++

desktop wrote: > I seem to have figured out that: > > a < b ? b : a > > returns a when a < b = false and b when a < b = true > > but what is the statment: > > Exp ? Exp : Exp > > called? Could not find anything describing it in my book Accelerated > C++ The official name of that _operator_ is "conditional". As in "the conditional operator". It's the only *ternary* operator in C++ (one that has three operands). It's not overloadable. V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, please don't ask

On 23 Apr, 14:24, desktop <> wrote: > I seem to have figured out that: > > a < b ? b : a > > returns a when a < b = false and b when a < b = true > > but what is the statment: > > Exp ? Exp : Exp > > called? Could not find anything describing it in my book Accelerated C++ The operator is called the Conditional Operator and an expression using it like your example is a Conditional Expression. Gavin Deane

desktop : > I seem to have figured out that: > > a < b ? b : a > > returns a when a < b = false and b when a < b = true > > but what is the statment: > > Exp ? Exp : Exp > > called? Could not find anything describing it in my book Accelerated C++ cond ? expr1 : expr2; I think they are the same. -- Thank you very much! Thank this newsgroup very much! Visual Studio 2005 Professional Edition Windows XP Professional

"desktop" <> wrote in message news:f0ic0o$kcf$-c.dk... > but what is the statment: > Exp ? Exp : Exp > called? Could not find anything describing it in my book Accelerated C++ It's on page 45, where it's described as the "conditional operator" Page 45, in turn, is mentioned in the index under the "?:" heading.

It's called the conditional operator, though it's also commonly known as the ternary operator, since it's the only one in C++. Ranok