Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch 语句的语义 - Luyu Huang's Tech Blog #56

Open
luyuhuang opened this issue Nov 14, 2021 · 0 comments
Open

Switch 语句的语义 - Luyu Huang's Tech Blog #56

luyuhuang opened this issue Nov 14, 2021 · 0 comments

Comments

@luyuhuang
Copy link
Owner

https://luyuhuang.tech/2021/11/14/switch-statement.html

switch 语句一般用于多重分支选择. 不过 switch 的语义与 if ... else if 完全不同, 它更像是 goto 语句. switch 只接一个语句块, 语句块中可以包含一些 case 跳转标签, switch 先对表达式求值, 然后跳转至对应的标签. break 可以跳出 switch 语句...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant