C # is also a half-way home, the foundation is not very good. In the past few days, I re-learned "C # entry classic", it is based on the foundation. The first three chapters have been read, and I started to see Chapter 4 today.
§1 C # Introduction
§2 Write C # program
§3 variables and expressions
§4 process control
Branch, cycle
§4.1 Boolean logic
Boolean comparison relationship =,! =, <,>, <=,> =
Bool islessthan10; islessthan10 = myVal <10;
! Logic is not logical and | logic or ^ logical varying or
&&, || More performance: Check the value of the first operand, the second may not need to check
1. Bit operator &, | These two operators can be used to perform operations to the value, in fact, they handle a series of bits stored in the variable, rather than the value of the variable ^ ~ Reverse >>, < > v3; Move the V3 bits to the right to the right, get the value of V1 2. Boolean value operator & = use &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&= <= 3. The priority of the operator update high , (for prefix); (); , - (one dollar) ;!; ~ *, /,% , - <<, >> | <,>, <=,> = | ^ | && || =, * =, / =,% =, =, - =, << =, >> =, & = , ^ =, | = Low , - (used as a suffix) 4.goto statement C # allows the statement plus the label 4.2 branch 1. Trimer operator ? : Compare In a simple assignment statement, it is not suitable for performing a large number of code based on comparison results 2. IF statement in order to perform other statement IF ()} else if () {} else} else}} else {} 3.switch statement Switch statement is very similar In the IF statement, because it is also conditionally executed according to the value of the test. However, the Switch statement can be compared to multiple values, rather than testing only one criteria. This test is limited to discrete values, rather than classes like "greater than X", so it's a bit different. Switch () {CASE: BREAK; CASE: BREAK; If you put multiple CASE statements (stack them), then add a row of code, which is actually checked multiple conditions. If you meet any of these conditions, you will execute the code.