In the C ++ programming language, some judgment statements exist, such as the if and C ++ switch-case statements. In this article, we will introduce the basic usage of the C ++ switch-case statement in detail, hoping to help you.
Detailed
Switch-case retrun break, switch-caseretrun
{
If statements process two branches, the if-else-if structure must be used when processing multiple branches. However, if there are many branches, the more nested if statement layers, the program is not
The If statement handles two branches and uses the IF-ELSE-IF structure when dealing with multiple branches, but if there are more branches, the more nested IF statements layer, The procedure is not only large but also difficult to understand. Deep
Switch case is a qualified data in js, which is much simpler than if else. Next I will introduce my understanding of js switch case.
In the if Condition Statement, only one logical condition can exist. if multiple conditions exist, you can use
In summary, the use of switch is to determine if the expression after the case matches the expression after switch, and once the case is matched, the subsequent program code is executed, regardless of whether the following case matches until the
In an IF condition statement, a logical condition can only have one, and if there are multiple conditions, it can be resolved using nested IF statements, but this method increases the complexity of the program and reduces the readability of the
I. Class Declaration
// A class is a user-defined type. The declaration form is as follows:Class Name{Public:Public Member (external interface)PRIVATE:Private memberProtected:Protect members};
After the public keyword, declare that they are class
The If statement handles two branches and uses the IF-ELSE-IF structure when dealing with multiple branches, but if there are more branches, the more nested if statement layers, The procedure is not only large but also difficult to understand.
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.