0316.Net the basis of the fifth day of class notes

1, debugging
1: After writing a program, want to see the process of the implementation of this program.
2: When you finish this program, found that the program did not go as you think to look.
Debugging method:
1), F11-by-statement debugging (stepping)
2), F10-by-process debugging
3), breakpoint debugging

2, for loop
syntax:
for (Expression 1; 2 Expression; Expression 3)
{
loop body;
}
expression 1 is generally circular declared variable, the number of recording cycles (int i = 0;)
expression is generally 2 the cycling conditions (i <10)
expression 3 is generally cycling conditions to change the code, one day the circulation condition is no longer true (i ++).
Execution: The program starts executing the expression 1, declare the loop variable used to record the number of times a loop,
and then execute the expression 2, determine the loop condition is satisfied, if the expression evaluates to 2 returns true,
the loop body is executed. After one complete loop, performed expression 3, expression 2 then continues to determine execution cycle condition is established,
if the establishment of the loop continues, if not true, out of for loop.

. 3, int.TryParse
int.Parse
try to convert a string to type int.

4, ternary expression
syntax:
Expression 1 Expression 2: Expression 3;?
Expression 1 is usually a relational expression.
If an expression evaluates to true, then the value of the expression 2 is the value of the ternary expressions.
If an expression is false, then the value 3 is the expression value of the ternary expressions.
Note: The result of the expression of type 2 must be consistent with the result of the expression of type 3, and also to keep the same type of result ternary expressions.

Published 17 original articles · won praise 0 · Views 720

Guess you like

Origin blog.csdn.net/weixin_44623941/article/details/104909443