MindMap Gallery Loop (C language)
In C language, a loop is part of a control flow statement that is used to repeatedly execute a section of code until a specific condition is met. The C language provides several different types of loops, including for loops, switch statement loops, and do-while loops.
Edited at 2024-01-29 01:16:29Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
cycle
一、 switch statement
A. structure
switch()-->The expression inside the brackets switch is the keyword
1. Must be a == expression
2. On the left side of the equal sign, the expressions are the same
3. The right side of the equal sign must be a constant, and the numbers must be different from each other.
B. Multiple use cases
In a branch condition: Normally
Use if...else if...else for three branch conditions
For more than three branch conditions, use switch...case...default
C. Jump out of case---break
D. switch...case-->will allocate 4 more bytes of space to store the result of the expression for judgment
E. How to compare
switch...case-->Compare with the largest value
The case is followed by a constant (numeric value). If the case constant starts with 0, it is directly compared with the largest case constant.
If you start from other numbers, it is compared with the largest constant - the smallest constant.
Array addressing starts from 0
F. Four situations of case values:
1. The case values are continuous, and a case table will be created. What is placed in the table is the address of the case
2. The case values are relatively continuous, and two case tables will be created. The first one is the number list, which contains the case number. If there is no case, It will fill in the number of cases, which is the corresponding default address. The second one is the address form, still filled in with the address of the case. Use the number to get the address ---> save space
3.case values are discontinuous and can be compared directly, just like if Select half search (binary search) ---> Must be sorted first, look at the middle, left/right
4. The fourth situation combines the previous three
二、 do....while statement
A. while statement syntax
while (expression)--->while is the keyword (expression)
{
In the middle is the while statement;
}
B. The difference between if and while
The difference between if and while: while has one more jmp statement than if (jumps up)
while--->There must be a conditional judgment expression inside the brackets (There must be corresponding exits), otherwise it will easily cause an infinite loop.
If add a goto statement to imitate the while loop
goto-->equivalent to jmp statement
C. The difference between break and continuer
break breaks out of the loop,
continue to end this loop (an exit needs to be added), When using it, set the exit above continue. -->Otherwise, it is easy to cause an infinite loop
If the exit is below, you need to set the loop exit yourself.
Export cannot store results
continuer
D. do....while
do
{
Statement; ---->The statement is between the curly brackets
} while(); do while is a keyword, and there is a semicolon after while
E. The difference between while and do...while
1. while is to judge the condition first and then execute the statement
2. do...while executes the statement first and then determines the condition
三、 for loop
A. for statement format
for(expression1;expression2;expression3)
{
statement ;
}
B. condition
for-->keyword
Expression 1--->Initialize variables You can initialize one or more
Expression 2--->Judge loop conditions
Expression 3--->Variable increment or decrement (i or i--)
A jmp will be inserted in the middle of the disassembly of the for loop and jump to the loop judgment condition.