Learn C++ With Me #8 - If, Else & Else If

  Рет қаралды 39,445

Tech With Tim

Tech With Tim

Күн бұрын

Пікірлер: 34
@yxlxfxf
@yxlxfxf 3 жыл бұрын
It's important to note that "else if" isn't a separate type of statement like "elif" in python, it's just an "else" that happens to be followed by another "if"
@josephcohen734
@josephcohen734 3 жыл бұрын
Thanks. I always wonder about this with new languages.
@Lucas-yh5zz
@Lucas-yh5zz 3 жыл бұрын
Wait but if that's the case wouldn't the second if statement be inside the else's block of code? Like this: If (condition 1) { } Else { If (condition 2) { } }
@yxlxfxf
@yxlxfxf 3 жыл бұрын
@@Lucas-yh5zz what you wrote is valid c++, but if/else clauses do not require a code block, they can be directly followed by a single statement without curly braces. You can write things like: if (a) statement1; else statement2; If statement2 is another if-statement, you get the "else if" construction, but the "else" is totally separate from the "if" that follows it. You can put any other keyword there, like "else for", "else while" or anything really, those aren't new types of statements but just an "else" followed by a separate statement.
@pimpwiththis8885
@pimpwiththis8885 3 жыл бұрын
Your teaching method is impeccable, love your videos...
@ananthramvijayaraj4554
@ananthramvijayaraj4554 3 жыл бұрын
Congrats on 600K subs!!
@hawking3396
@hawking3396 3 жыл бұрын
Your building such a cornerstone for all and sundry .
@onurcanokay
@onurcanokay 3 жыл бұрын
I think you should have included the "switch" statement. Nice vid. Thanks!
@yourdadsbestfriend7101
@yourdadsbestfriend7101 3 жыл бұрын
great vid tim
@shedrackjassen913
@shedrackjassen913 2 жыл бұрын
Tim, your the best bruh😎😎😎
@seireiart
@seireiart 3 жыл бұрын
I couldn't hold my laugh when I read the title because I remember a famous gamedev (or infamous if you will) using them as his life depending on it xDD
@megnus3rs
@megnus3rs 5 ай бұрын
what's their name
@seireiart
@seireiart 5 ай бұрын
@@megnus3rs It's none other than YandereDev lol
@aoronbarlow6524
@aoronbarlow6524 3 жыл бұрын
Hi Tim Thanks for this Series. I'm seeing that every single ML job description is listing C++ experience as prerequisite although python and its libraries are there. So are there any plans to make ML with C++ series ? I don't know why C++ is required for ML engineering positions. Could you also elaborate that little bit?
@KhalilYasser
@KhalilYasser 3 жыл бұрын
Thanks a lot Tim.
@TheShehabKhan
@TheShehabKhan Жыл бұрын
Helpful!
@videokriitikko5509
@videokriitikko5509 3 жыл бұрын
Nice, maybe "Learn C With me" next !
@mastershooter64
@mastershooter64 3 жыл бұрын
C is basically the same as c++ but without a few stuff, like classes, object-oriented programming stuff like abstraction, inheritance, etc. But the basic syntax is the same, most of the time you can code in c with only c++ knowledge
@Davidku632
@Davidku632 3 жыл бұрын
Another reason of using else if instead of if is performance. 1000 ifs will run slower than 1000 if and else ifs because in first case all of them are running even if one is true while in second case if one is true the rest won't run
@AlfredAceic
@AlfredAceic 2 ай бұрын
Perfect.
@codewithlikhit
@codewithlikhit 3 жыл бұрын
Can you post a advanced tutorial on a full stack web app
@neontuts5637
@neontuts5637 3 жыл бұрын
Nice Video. Is their shorthand method to do conditional in C++. Like the ternary-operator in JavaScript?
@neontuts5637
@neontuts5637 3 жыл бұрын
@Shivansh Sahu Oh! It's same in JS. Thanks🙏
@notme1282
@notme1282 3 жыл бұрын
you don't actually need curly braces for the if statement, as long as the indentation is proper
@shubhrajit2117
@shubhrajit2117 Жыл бұрын
Thanks ;)
@ThePhantomCoder
@ThePhantomCoder 3 жыл бұрын
Hey Tim! 😀 So I wanted to ask you to try out TabNine for a week or so. It's an amazing ai auto-completion tool, but I like it so much better then Kite, especially for repetitive code. Kite pro is probably better then TabNine free, but assuming you use the free version I think you should try it out and maybe make a video about it if you like it.
@salafytech8578
@salafytech8578 3 жыл бұрын
What is the difference between C and C++
@dr.schlopp4089
@dr.schlopp4089 3 жыл бұрын
Basically C++ >= C, but with classes and a few other OOP data type additions. You could essentially run any C scripts in C++, but you can't run all C++ scripts using C, if that makes sense.
@KamutangaKawina
@KamutangaKawina 4 ай бұрын
why are some videos more clear than others
@ggsap
@ggsap 3 жыл бұрын
You look like sheldon cooper's small brother
@leojoliver6009
@leojoliver6009 3 жыл бұрын
It's Episode 7 not 8
@brendancao2267
@brendancao2267 3 жыл бұрын
6th
@redoansaleh
@redoansaleh 3 жыл бұрын
10th view 10th like
Learn C++ With Me #9 - Arrays
21:35
Tech With Tim
Рет қаралды 106 М.
If Else Statement In Java Tutorial #17
7:39
Alex Lee
Рет қаралды 338 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Learn C++ With Me #7 - Logical Operators (And, Or and Not)
12:25
Tech With Tim
Рет қаралды 22 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 847 М.
Conditionals (if-else, Nested if and else if)
8:10
Neso Academy
Рет қаралды 383 М.
Learn C++ With Me #18 - Vectors
13:05
Tech With Tim
Рет қаралды 162 М.
If statements in Python are easy (if, elif, else) 🤔
8:21
Bro Code
Рет қаралды 165 М.
CONDITIONS and BRANCHES in C++ (if statements)
23:43
The Cherno
Рет қаралды 314 М.
Why You Shouldn't Nest Your Code
8:30
CodeAesthetic
Рет қаралды 2,8 МЛН
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 410 М.
Learn C++ With Me #20 - Functions
26:14
Tech With Tim
Рет қаралды 59 М.