hackingcpp / comments

Comments regarding hackingcpp.com
0 stars 0 forks source link

cpp/lang/control_flow_basics #4

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

C++ Basic Control Flow Overview | hacking C++

The basics of C++ control flow constructs: conditions, loops and switches.

https://hackingcpp.com/cpp/lang/control_flow_basics.html

jakr commented 2 years ago

Thanks for writing this introduction! In the section Conditional Branching, the comment on line 3 if(0) does not match the output.

hackingcpp commented 2 years ago

Thanks! I fixed it.

emretufekci commented 2 years ago

Thank you for this tutorial it is really good one!

I think good to mention, We can't declare a variable in switch case label until if it hasn't curly brackets " { } "

more information: https://stackoverflow.com/questions/92396/why-cant-variables-be-declared-in-a-switch-statement