else keyword

   
else keyword Else part of if statement

  statement  := if (  condition  )  statement  else  statement  

The else keyword introduces the else part of an if statement. If the condition is false, the else statement is executed.

Example

 template<typename T> T abs(T x) {   if (x < T(  ))     return -x;  else  return x; } 

See Also

if , statement , Chapter 4

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net