Learn C++ With Me #12 - Switch Statement

  Рет қаралды 22,741

Tech With Tim

Tech With Tim

Күн бұрын

Пікірлер: 28
@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 11 ай бұрын
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.
@QuaternionPhysics1
@QuaternionPhysics1 3 жыл бұрын
Can’t wait for the more advanced stuff! Amazing series so far, probably the best 👀 Keep it up, Tim!
@paulzupan3732
@paulzupan3732 3 жыл бұрын
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.
@seireiart
@seireiart 3 жыл бұрын
Finally, the tutorial YandereDev need to watch the most LMAO XDD
@thatdude8368
@thatdude8368 2 жыл бұрын
Like how you go very in depth to everything em explain everything all the way through
@aaravgp1332
@aaravgp1332 3 жыл бұрын
I have finally got ther confirmation for vectors, pointers and refferences, which is what I was waiting for in the series
@mariustrelea5132
@mariustrelea5132 3 жыл бұрын
I was waiting for new c++ lesson 😁😁😁
@Gilmore_Coding
@Gilmore_Coding Ай бұрын
Nice this one is just like the match case in python
@Jordan4Ibanez
@Jordan4Ibanez 3 жыл бұрын
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
@finnqni8563
@finnqni8563 3 жыл бұрын
Thanks for you content Tim ;)
@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.
@195dawids
@195dawids 3 жыл бұрын
What chair are you using dude?
@TrueGemsOnly
@TrueGemsOnly 3 жыл бұрын
My education system failed, this youtube man excelled
@zolbooenkhjargal2670
@zolbooenkhjargal2670 2 жыл бұрын
ty
@yourdadsbestfriend7101
@yourdadsbestfriend7101 3 жыл бұрын
yes tim!
@mbmeweg293
@mbmeweg293 3 жыл бұрын
Thank ya)
@pravachanpatra4012
@pravachanpatra4012 3 жыл бұрын
Can you make more pygame and tutorials please in python.
@keshav.mishra
@keshav.mishra 3 жыл бұрын
Tim! Which degree are you doing Bsc (computer science) or Btech (computer science)
@bobdeath5
@bobdeath5 3 жыл бұрын
How much focus will you be putting on creating graphics or seperate windows in future videos?
@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.
@snknoid
@snknoid 3 жыл бұрын
pls make video 5 ideas for game in pygame
@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
Рет қаралды 23 М.
Learn C++ With Me #20 - Functions
26:14
Tech With Tim
Рет қаралды 60 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Switch Statement - C++ Tutorial 11
9:17
Caleb Curry
Рет қаралды 8 М.
Mastering Python - Everything You Need To Know To Become a Python Master
16:02
C++   Tutorial - 21 - Switch Statement
5:35
thenewboston
Рет қаралды 393 М.
Learn C++ With Me #11 - While, Do While Loops & Break/Continue
24:01
The Self Taught Developer Checklist
17:38
Tech With Tim
Рет қаралды 122 М.
Learn C++ With Me #18 - Vectors
13:05
Tech With Tim
Рет қаралды 164 М.
C++ Tutorial for Beginners - Learn C++ in 1 Hour
1:22:56
Programming with Mosh
Рет қаралды 4,5 МЛН
Learn Ollama in 15 Minutes - Run LLM Models Locally for FREE
14:02
Tech With Tim
Рет қаралды 29 М.
Object Oriented Programming (OOP) in C++ Course
1:30:26
freeCodeCamp.org
Рет қаралды 2,6 МЛН
Learn C++ With Me #9 - Arrays
21:35
Tech With Tim
Рет қаралды 108 М.