C++ Switch Statement. In this video, you will learn how to use a switch statement for comparing values instead of using an if/else condition statement. With a switch statement, at compile time, a jump table/look up table is created, which maps each case value. With the table, C++ will jump to the case that matches the value. This is much more performant than an if/else statement, where we need to check each individual if statement until we hit our condition. This is known as the if/else ladder.
In addition, you will learn how to group switch cases together and use the break statement to exit the switch case code blocks.
C++ Playlist:
https://www.youtube.com/playlist?list=PLnKe36F30Y4ZDNIOZ51sX25pWKQ1pkpTE
Github Repo for C++ Code:
https://github.com/ImKennyYip/cpp
Install C++ with VS Code:
https://youtu.be/DMWD7wfhgNY
Subscribe for more coding tutorials !