Learn C++ With Me #12 - Switch Statement

  Рет қаралды 21,943

Tech With Tim

Tech With Tim

Күн бұрын

Пікірлер: 27
@satvikreddy8662
@satvikreddy8662 3 жыл бұрын
Just a note for this video that I think is important to point out. Apart from the switch statement being more elegant, it is also more efficient, especially when you have lots of cases. The reason being, a switch statement is generally implemented with a hash table or a similar data structure, giving you (ideally) an O(1) time complexity to get through the switch. With an if statement, worst-case scenario, you have to compare your variable to every single case, leaving you with an O(n) time complexity, n being the number of cases, which can be slow.
@rmt3589
@rmt3589 9 ай бұрын
Hence why I'm here. Someone I loathe refuses to use these, and has pages of if/else. I want to be nothing like him, so I'm doubling down.
@paulzupan3732
@paulzupan3732 2 жыл бұрын
There's one drawback to the switch statement that's quite important, and that is the fact that the cases in the statement must be compile-time constants. So if you get errors that a variable is not usable in a constant expression or the compiler complains about a call to a non-constexpr function, that's why.
@thatdude8368
@thatdude8368 2 жыл бұрын
Like how you go very in depth to everything em explain everything all the way through
@QuaternionPhysics1
@QuaternionPhysics1 3 жыл бұрын
Can’t wait for the more advanced stuff! Amazing series so far, probably the best 👀 Keep it up, Tim!
@aaravgp1332
@aaravgp1332 3 жыл бұрын
I have finally got ther confirmation for vectors, pointers and refferences, which is what I was waiting for in the series
@seireiart
@seireiart 3 жыл бұрын
Finally, the tutorial YandereDev need to watch the most LMAO XDD
@Jordan4Ibanez
@Jordan4Ibanez 2 жыл бұрын
Switch statements create jump tables when they are compiled into machine code, for a huge list that, let's say is running 165 times a second in a list of 1000 items, this performance improvement can be EXTREME
@mariustrelea5132
@mariustrelea5132 3 жыл бұрын
I was waiting for new c++ lesson 😁😁😁
@user-sy3ny1sz2w
@user-sy3ny1sz2w 3 жыл бұрын
Switch statement can't use string a.k.a "std::string" and C string a.k.a "const char*" as expression.
@finnqni8563
@finnqni8563 3 жыл бұрын
Thanks for you content Tim ;)
@zolbooenkhjargal2670
@zolbooenkhjargal2670 2 жыл бұрын
ty
@TrueGemsOnly
@TrueGemsOnly 3 жыл бұрын
My education system failed, this youtube man excelled
@yourdadsbestfriend7101
@yourdadsbestfriend7101 3 жыл бұрын
yes tim!
@pravachanpatra4012
@pravachanpatra4012 3 жыл бұрын
Can you make more pygame and tutorials please in python.
@195dawids
@195dawids 3 жыл бұрын
What chair are you using dude?
@bobdeath5
@bobdeath5 3 жыл бұрын
How much focus will you be putting on creating graphics or seperate windows in future videos?
@snknoid
@snknoid 3 жыл бұрын
pls make video 5 ideas for game in pygame
@keshav.mishra
@keshav.mishra 3 жыл бұрын
Tim! Which degree are you doing Bsc (computer science) or Btech (computer science)
@mbmeweg293
@mbmeweg293 3 жыл бұрын
Thank ya)
@lemahtab
@lemahtab Жыл бұрын
So, this is similar to SQL's CASE statement, right? Don't need it but is better than IF ELSE in some cases.
@JimPageGD
@JimPageGD 3 жыл бұрын
Cool
@shehanprasanna3905
@shehanprasanna3905 3 жыл бұрын
@melissajones5269
@melissajones5269 3 жыл бұрын
huzzah
@rayaanibrahim4808
@rayaanibrahim4808 3 жыл бұрын
2nd
@DATABRO6130
@DATABRO6130 3 жыл бұрын
Bro can u please explain about power shell please bro i need it please🙏🙏🙏🙏
@bobdeath5
@bobdeath5 3 жыл бұрын
What are you looking to do with PS
Learn C++ With Me #13 - Strings
5:56
Tech With Tim
Рет қаралды 22 М.
Learn C++ With Me #9 - Arrays
21:35
Tech With Tim
Рет қаралды 93 М.
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 5 МЛН
Learn C++ With Me #14 - References (&)
12:29
Tech With Tim
Рет қаралды 26 М.
Learn C++ With Me #8 - If, Else & Else If
17:05
Tech With Tim
Рет қаралды 37 М.
C++ switch tutorial (#7) 🔀
10:13
Bro Code
Рет қаралды 7 М.
Learn C++ With Me #17 - Maps
24:35
Tech With Tim
Рет қаралды 78 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 728 М.
15 Years Writing C++ - Advice for new programmers
4:04
SyncMain
Рет қаралды 1,3 МЛН
Switch Case - C++ Tutorial For Beginners #10
7:44
NeuralNine
Рет қаралды 11 М.
Learn C++ With Me #10 - For Loops
16:11
Tech With Tim
Рет қаралды 32 М.
How to Learn to Code FAST (Do This or Keep Struggling)
11:00
Andy Sterkowitz
Рет қаралды 717 М.