C++ Tutorial 8: Switch Statements @WhatsACreel
C++ Tutorial 8: Switch Statements  @WhatsACreel
Uploaded September 2012 | Updated September 2026, 2 weeks ago
Today we'll look at switch statements, cases and their default code blocks. It's an interesting control structure. It's possible to program without using switch at all, but switch is often a clearer than a collection of if, else if and else.

The example at 7:10 is wrong. The output I've described is right but my reasoning is not. As pointed out by FullRock, the case 20 will run regardless of the value of "j". After a case executes, C++ does not check the conditions again and continues executing until it finds break.
C++ Tutorial 8: Switch StatementsLearn Python Programming 4: Learn For LoopsExploring Cliques and Clique ProblemsC++ UnionsIEEE 754: 64 Bit Double Precision Floatsx64 Assembly Tutorial 63 B: Box Blur C++ CodingNVIDIA CUDA Tutorial 2: Basics and a First KernelC++ Tutorial 20: Inheritance BasicsModern x64 Assembly 1: Beginning Assembly ProgrammingWeird Trick with Adjacency MatricesHow to Convert Decimals to Binary and Binary to Decimal NumbersImplementing a Semaphore
Creel |

C++ Tutorial 8: Switch Statements

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER