Chapter 04
4.1
1. var1 = var2 ^ var3;
2 .&
The results are the same,
4.1.1
1. processing is a series of bits stored in the variable, rather than the value of the variable.
&
<// Var1 = var2 <var3
>>// Var1 = var2 <var3
This number is multiplied by the number of shifts to the left.
Notice
In most codes, these operators are not used. They are mainly highly optimized code and cannot use other mathematical operations in the code. Therefore, they are usually used for device drivers or system code.
4.1.2
& =
<=
4.2 goto
1. C #
Goto
Goto <labelname>;
Tag definition:
<Labelname>:
// Code
4.3
1. Three branch technologies: ternary operators,
4.3.1
<Test>? <ResultTrue>: <resultFalse>
4.3.2 if
4.4.3switch
1. switch
2. After executing each part of the code, another statement is required.
3. In addition
4. if multiple
Switch
{
Case <comparisonVal1>:
Case <comparisonVal2>:
<Code to execute>;
Break;
......
}
5. Each
4.4
4.4.1 do... while
Execute the loop code and then perform a Boolean test. If the test result is
Do
{
<Code to be looped>
} While (<test> );
4.4.2 while
While
While
{
<Code to be looped>
}
4.4.3
This type of loop can execute a specified number of times and maintain its own counter.
For (<initialization >;< condition >;< operation>)
{
<Code to loop>
}
4.4.4
Notice
Use