•  Back 
  •  C Language 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : C-Language Documentation
Author      : John Kormylo
Version     : C.HYP 1.0
Subject     : Documentation/C-Language
Nodes       : 233
Index Size  : 6362
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : en
@default    : 
@help       : Help
@options    : +g -i -s +x +z -t4
@width      : 75
View Ref-File[ Conditional Operator  '?' ]

  Lvalue = <test> ? Rtrue: Rfalse;

where <test> is a logical expression.  This is equivalent to

  if( <test> ) Lvalue = Rtrue;
  else Lvalue = Rfalse;

The advantage of the conditional operator can be seen when Lvalue is
a complicated expression (involving arrays of pointers to structures
containing unions with pointers ...).  The savings is in program size
rather than speed.