C#.net's fifth day study

Source: Internet
Author: User

1, * program debugging
1), after the completion of a program, want to look at the implementation of this procedure.
2), when you finish writing this program, found that the program did not follow the way you think to do.

Debugging method:
1), F11-by-statement debugging (single-Step debugging)
2), F10 process debugging
3), breakpoint debugging

2. For loop
Grammar:
for (expression 1; expression 2; expression 3)
{
Circulation body;
}
Expression 1 is generally declared as a loop variable, the number of times the loop is recorded (int i=0;)
Expression 2 is generally a cyclic condition (i<10)
Expression 3 is usually the code that changes the loop condition so that the loop condition ceases to be true one day (i++).
Execution procedure: The program first executes expression 1, declares a loop variable used to record the number of cycles,
The expression 2 is then executed to determine if the loop condition is true, and if the expression 2 returns the result
The loop body is executed. When the loop body is executed, the expression 3 is executed, and then the expression 2 continues to determine whether the loop condition is true, and if so, the loop body is executed, and if not, the for loop is popped up.

3, Int. TryParse
Int.parse
An attempt was made to convert a string to an int type.

4, three-dimensional expression
Grammar:
Expression 1-expression 2: expression 3;
Expression 1 is typically a relational expression.
If the value of expression 1 is true, then the value of expression 2 is the value of the entire ternary expression.
If the value of expression 1 is false, then the value of expression 3 is the value of the entire ternary expression.
Note: The result type of expression 2 must be the same as the result type of expression 3, and also consistent with the result type of the entire ternary expression.

C#.net's fifth day study

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.