Head A C # Chinese version chapter II page67

Source: Internet
Author: User

The If/else statement decides to use the If/else statement to tell the program to do certain things when you set the state to be true (or false). Many if/else statements check that two expressions are equal. Then you need to use the = = operator. This is different from the = operator you use to assign a value.

Don't get confused by the double operator! You assign a value to a variable with an equal sign (=), but the two equals sign (= =) is used to compare two variables. You can't believe how many bug--in the program even the veteran programmer wrote it! --it is because of the wrong to use = =. If you see the IDE prompting you to "not implicitly convert int to bool," that might be the wrong thing to say.

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.