Wu Yuxiong - born natural C ++ language study notes: C ++ judge

Analyzing structure requires the programmer to specify one or more conditions to be evaluated or tested, and the statement Statement (necessary) condition is false, and to execute (optional) condition is true be executed. 
The following is the general form of most programming languages typically determines the structure:

Analyzing the statement
 if the statement an if statement is followed by a Boolean expression of one or more statements.
if ... else statement a if the statement with an optional else statement, else statement executes the Boolean expression is false. 
Nested if statements may be in one if or the else  if used within another statement if or the else  if statement.
switch statement is a switch case statement allows to test a plurality of values of the variable is equal. 
Nested switch statement can be a switch with another statement within the switch statement.
? : Operator 
Exp1 ? Exp2: Exp3; 
which, Exp1, Exp2 and Exp3 an expression. Please note that the use of the colon and location. 
? Value of the expression is determined by the Exp1. If Exp1 true, Exp2 value is calculated, the result is the whole? Value of the expression. If Exp1 is false, Exp3 value is calculated, the result is the whole? Value of the expression.

 

Guess you like

Origin www.cnblogs.com/tszr/p/12147669.html