Lesson 4. Boolean types and reference

1. Boolean

c ++ c language on the basis of the type of system to increase the bool
bool type value is only true (non-zero) and false (0) (true representative of the true, the compiler 1 represents; false false and compiler of 0 means)
theoretically only bool one byte
c ++ compiler will be converted to a non-zero value true, the value is converted to false 0

2. The ternary operator

c language ternary operator returns the value of the variable; value is not used as the left-
c ++ ternary operator in direct return variable itself; rvalue can be used, but also the use (as the only operation left value trinocular when the character is a member variable can be realized)
Note : ternary operator value may be returned if there is a constant value, the value can not be used as a left
following cases are compiled by the case where the members are variable

The following case is one of the members is not compile time constants

In reference 3.c ++

Guess you like

Origin www.cnblogs.com/huangdengtao/p/11753152.html