See, this is the easier stuff. Those last few tutorials on classes got me really tangled once you introduced constructors.
@beri41387 жыл бұрын
A constructor in a class is the same as a function in a class. The only differences are: - A constructor has the same name as the class itself. - Instead of being called, a constructor runs automatically when you declare an object of that class.
@top10detrax457 жыл бұрын
cool you just cleared out my doubts :D
@nepalihercules6 жыл бұрын
when in doubt, cout.
@dbc201theking6 жыл бұрын
Gaming Turkey Also constructors don’t return anything?
@theseangle4 жыл бұрын
@@dbc201theking they physically can't
@RunItsTheCat10 жыл бұрын
I am 500 years old and I am offended.
@DerickZ2810 жыл бұрын
Why are you still alive?
@Pinkiepyro110 жыл бұрын
stonecoldtrk probably cheats.
@ТайныйЯ-к3ь9 жыл бұрын
Constantine Leon Don't be so rude...
@Pinkiepyro19 жыл бұрын
Тайный Я It was in reference to the video.
@ТайныйЯ-к3ь9 жыл бұрын
Pinkiepyro1 I know.:D
@meganradley70849 жыл бұрын
This is perfect! I love the way you describe these so easily, it really makes sense. Thank you so much for these!
@BradenBest8 жыл бұрын
Would've been a perfect opportunity to introduce the && operator. Also, just because you can nest if blocks, doesn't mean you should. Unnecessary nesting leads to unnecessary complexity. Use functions instead. if(someCondition) functionForThatCase([necessary values]); else someOtherFunction([etc])
@KlaPzCA6 жыл бұрын
I just made something really simple with if/else statement I'm happy to see myself progressing... #include using namespace std; int main() { int x; cout x; if(x
@dibbiepk12 жыл бұрын
"Wow, you are old" "You are young, geta job" What a nice and friendly program, HOW MUCH!? :P
Someone is going to watch this in 2500 and be greatly offended by you saying "if you are 178 years old, you should be dead."
@marcopolo55415 жыл бұрын
Do you think C++ will still be relevant by then? Or worse, do you think humans will still be relevant by then?
@dashcampower46224 жыл бұрын
@@marcopolo5541 c++ has like infinite potential. its an extension to C and its library gets bigger and bigger like every 2 years
@nipunfernando76887 жыл бұрын
Wow this helped alot, I was confused with these at first but not anymore. Thanks bro
@ionyjula248812 жыл бұрын
wow Bucky...you are the best teacher online. 10 of 10!!!! I did"n know nothing about programming and now...I am learning C++...with the best teacher in the world. Yours videos are AWESOME!!!!!God bless you! and many thanks!!!
@odo43211 жыл бұрын
I am doing exactly this. Helps allow me to remember stuff from previous tutorials while integrating them in the newer ones. Usually I forget everything I learn soon after so now I have created a personalised forum. Writing everything down with my own examples and at the end make example programs which integrate everything I have learned.
@TheYousif512 жыл бұрын
create an int call it "age", put "cin
@justinzheng30002 жыл бұрын
C++ is kinda insane
@Qazqi11 жыл бұрын
You can do if (std::getline(...)) to check whether it succeeded or if (std::getline(..., line) && line == "wanted line") to check if it succeeded and is the proper line.
@Blank-fe6wi2 жыл бұрын
Most of the times it's those technical terms that confuse and scare the sh*t out of you. Thanks for making such a each to understand tutorial.
@church77812 жыл бұрын
Yes, it will. The program works top to bottom, so if there is a line before the nested if statement, it will run it since the first if statement was true.
@dizzykitten92439 жыл бұрын
awesome, I dont know if he went over this because I stopped and wanted to try a few codes and with the prior knowledge I made them enter their age and if it was younger than 15yrs old it would say "Hey there young son" if it was older it would say "hey there elderly" PROUD OF MYSELF :D IM LOVING C++
@dustbinsavesyou82836 жыл бұрын
lol, I had python knowledge from the start so I wrote that in just 1hr learning c++
@nemesi88006 жыл бұрын
Yeah same :D Knowing any programming language, even with easy syntax like Python helps a lot. Otherwise I'd be struggling and be like... "wut.. why do I need this?" "What is this????" HEEEEEELP? lol
@newkid98076 жыл бұрын
Nemesi rip
@gm3avxdd7 жыл бұрын
Technically there is a maximum nesting depth of 256 (including the function).
@Faraz902312 жыл бұрын
Wrong, first of all, its cin >> age, and not cin
@dayeemouwon10 жыл бұрын
I need help on my c++ program and the question is has follow: A box of cookies can hold 24 cookies, and a container can hold 75 boxes of cookies. Write a program that prompts the user to enter the total number of cookies, the number of cookies in the box, and the number of cookie boxes in a container. The program then outputs the number of containers to ship the cookies. Note that each box must contain the specified number of cookies, and each container must contain the specified number of boxes. if the last box of cookies contains less than the number of specified cookies, you can discard it and output the number of leftover cookies. similarly, if the last container contains less than the number of specified boxes, you can discard it and output the number of leftover boxes..
@ThatGuyNamedBender11 жыл бұрын
Not trying to brag but knowing some languages before learning C++ this was fairly simple for me ^^ For the people who are like me here is a good challange. Make a class that handles the age calculations. So that your main.cpp file would basically look like this. int main(){ { ourClass.requestAge(); return 0; } or something like that xD
@PuckishAngeI3 жыл бұрын
me: *fucks up the code* age 3: "Why are you still alive?"
@MrAssassin149211 жыл бұрын
first video i have ever seen without dislikes.
@farristurner64434 жыл бұрын
Thank you! I'm learning from a 2003 textbook and it did not have the brackets...that's what was causing my code not to work
@coreydoyle470211 жыл бұрын
Theoretically, you can have an infinite number of if's inside of if's. -Cheers
@yoferenuntar64819 жыл бұрын
do we have elif in the c++??? or we can just type if below the if???
@ai.2015 жыл бұрын
Learn more from this then 1:20 hour slot at my stupid university.
@abhishekjaiswal31217 жыл бұрын
thanx, buckys u give lot information about c++ , but i don't understand what constructor is ?
@Robber712 жыл бұрын
The marked text in the tumbnail for this video looks like a sniper rifle!
@MontSteve3610 жыл бұрын
Thanks Bucky, I am 78!!!
@StoneSlayer11 жыл бұрын
Wow this is the first video with 100% like rate that i have seen!! Keep it up Bucky!!
@P3nk013 жыл бұрын
umm what kind of compiler are u using bucky ps i love your videos keep them coming ;];]
@bilalarain46328 жыл бұрын
I Love It
@sammy55764 жыл бұрын
love your channel thanks you awsome teacher
@johnlarios873 жыл бұрын
hey man my earth is older than 187 years old
@TheCosmicChicken12 жыл бұрын
As soon as Bucky suggested testing if they're over 100, I was like "I would output 'How are you still alive?'". Then Bucky's like "And then we're gonna write...cout...um...why are you still alive?" And I was like ":O"!
@kaleab1510 ай бұрын
Re-record over that, otherwise great content. Thanks
@TheCosmicChicken10 ай бұрын
People do live to be over 100 sometimes. Perhaps a better output would be: "Congratulations on such a long life!"
@veer44195 жыл бұрын
"If you are over 100, why are you still alive?" - That is cold. I hope you know that now scientists are saying that people will easily live to 150, 200 years old in the not-so-distant future.
@simon-yi6jv3 жыл бұрын
2:30 { cout
@frangallagher894111 жыл бұрын
That is actually a brilliant idea! Nice thinking
@TehOnlyShoe11 жыл бұрын
Lots of different languages use the "if" statement. It's a common thing. But apart from that, yeah they are pretty dang similar lol.
@dylangriffiths746411 жыл бұрын
Can you use the getline function with an if statement to verify if the users input is correct or not?
@allankamoga54776 жыл бұрын
well understood..... the simplest tutorial
@Civik_123_2 жыл бұрын
Bro I'm 10 and I understand. You teach so good! Thank you
@mr.ANIMAT0N2 жыл бұрын
I am 106 and you have destroyed my dreams in learning programming. Just kidding 😛
@Halvard199210 жыл бұрын
I happen to be 178 and I find this offensive! >:3
@marianadeltoro825910 жыл бұрын
hey newboston! how are? thank for your video. I am a college student and actually I'm in a class of C++ programing.. so, I have to make this lab assigment which is killing meeee. Is about turning arabic numbers to roman numbers... so I was thinking if I can use the if else stamente for make the program... cause the professor want that the program accept numbers of years of 4 digits... =/
@Smiling_Tears11 жыл бұрын
Ok, I have a weird question. If I have a general loop and placed an if...else inside that loop, would that if statement be considered nested, or is an if statement only considered nested when it is within the scope of an outer if condition?
@yimjabo110 жыл бұрын
I don't know why but, for some reason, even though I have the same exact thing typed up as him I keep getting "warning: statement has no effect [-Wunused-value]". Can anyone help with that?
@rohanpandey99574 жыл бұрын
i have a question how to apply all these knowldege and i mean by that is how can we solve problem related to what he teaches us as if we dont do problems at that instant it will become of no use in future so pls guide me through it.
@StickMan13168 жыл бұрын
Here is what I came up with on my own after your if and else statement #include using namespace std; int main () { int x,y,z; cout > x; cout > y; cout
@MrPikmin38 жыл бұрын
+StickMan1316 i came up with this after watching this video #include using namespace std; int main() { start: int add = 1; int subtract = 2; int multiply = 3; int divide = 4; int a; int b; int answer1; int sum; cout > answer1; if(answer1==add){ goto addition; } if(answer1==2){ goto subtraction; } if(answer1==3) { goto multiplication; } if(answer1==4) { goto division; } if(answer1 > 4) { goto error; } if(answer1 < 1) { goto error; } addition: cout > a; cout > b; sum = a + b; cout
@StickMan13168 жыл бұрын
+Lukas Pratt Thats good. later in the c++ tutorials ur gonna learn about the switch statement... you are going to love!!!!!
@MrPikmin38 жыл бұрын
sure will, thanks
@givup_11 жыл бұрын
i know that this is pretty late but it doesn't print the else statement becouse there is no else statement for that if statement. That else statement is for the if(age > 100). Sorry for the bad english and hope i helped even a little.
@Himanshukumar-ow3fx5 жыл бұрын
bro i want answer of 1 question blowing my mind i spend 2 days on this still not done soccer club registring boys and girls for their camp,club represent player with there group as follow age =4 to 7. micro group 8 to 11 . junior group 12 to 15 . juvenile group 16 to 18 . senior group program to calculate 1.show in which category player will be. 2.how many players in each category. can you help me out bro
@crimsonking38736 жыл бұрын
can someone tell me why it says the the else If will never be executed //OPTIONS if (options == "Ranged" || "ranged") {cout > ranged;} else if (options == "Melee" || "melee") {cout
@crimsonking38736 жыл бұрын
Oh......
@crimsonking38736 жыл бұрын
Actually I was going to look up what you said since Im still new to programming and have memory loss so I have to take a lot of notes. Thanks for saving me time telling me.
@RuberSocks12 жыл бұрын
now your getting it
@ninjasensei98349 жыл бұрын
2:45, turn on captions, LYAO.
@stick45084 жыл бұрын
Lmao.
@brandlax12 жыл бұрын
Bucky should give us 'homeworks' so that we can practice it better! :D
@jeppemolin420696 жыл бұрын
how would i use the if statement but for currency i want to attempt to use it as an if Kr is more zero or less euro is x times that ?
@jasimali90313 жыл бұрын
Can you please give ma a link of 18th lecture?
@Benzzzy.4 жыл бұрын
I really love his voice
@TheaDragonSpirit12 жыл бұрын
I prefer 'if', then 'else if'... and 'else' as a safety net encase something went wrong and you really don't know why or what could have happened. For example, I type a letter and not a number. :P
@josephscinto93583 жыл бұрын
I love your sarcasm
@Sufi393 жыл бұрын
10 year anniversary?
@playertwo45582 жыл бұрын
My esle statement looks exatcly the same, but no matter what I try it gives me only the if statements answer
@NikorasuChan8 жыл бұрын
TRIGGERED!!!!!!
@theminecraftsorcerer30618 жыл бұрын
the only thing i hate about learning from videos is that i can't directly ask you why my program isn't working and show you my screen.
@newkid98076 жыл бұрын
The Minecraft Sorcerer ok minecraft sorcerer
@RAFMnBgaming8 жыл бұрын
somewhere yoda is looking at this and thinking "bitch please".
@dmitrij3412 жыл бұрын
Awesome Bucky!
@mrsmileycorps11 жыл бұрын
what i am doing is making a text based game and slowly improving it with the concepts i learn from bucky. Although im pretty sure you already know c++ by now XD
@honeypot1113 жыл бұрын
"let me go even deeper" Thats what he said lol.
@Parkseo2267 жыл бұрын
hey why we are not using cin here? when we exactly use cin?
@TheaDragonSpirit12 жыл бұрын
Has anyone else noticed that a small case "L" looks just like "1" or a One in this program. Sometimes I copy what he has put and my brain instinctively goes to the 1 key and not L. How odd.
@SinisterShrink11 жыл бұрын
Well he did say, "Let's go DEEPER...." So I think he was subliminally referencing to Inception. Nobody will ever know.....
@Xaeroxe11 жыл бұрын
You must be new to this :P A basic windows program has a WndProc that runs a switch statement that runs several layers of if statements, and is connected to functions outside of the WndProc. Shit gets complicated real fast :P
@TakingItCasual13 жыл бұрын
Awesome!
@SinisterShrink11 жыл бұрын
Question: Would nesting an if inside of an else be the same as an "else if" in Java coding?
@1...........123-t9b4 жыл бұрын
No
@pedro_navarro10 жыл бұрын
I hope our next generations don't ask some people the same question.
@zombieat8 жыл бұрын
do you really need the extra curly brackets before and after else?
@siaogaboh8 жыл бұрын
+mohammed6649 not necessarily, but a good practice, for readability of code.
@limyonghun0812978 жыл бұрын
i have a qns, if i put if else statement under if else statement is it possible? e.g if ( year ==1 ) { if (category == 1) { printf("ur great") } else if(category == 2) { printf("ur cool") } } else if ....... need help ASAP thanks
@Tylernal8 жыл бұрын
;
@chronixthegod8 жыл бұрын
This is C, not C++...
@KeyurKumbhare7 жыл бұрын
keyurk42.blogspot.in Find the notes of Bucky's C++ programming tutorials over here. Do share the message so that everyone can get the benefit.
@ArdawanKurdi3 жыл бұрын
Thank u dude
@shehuadesanya199010 жыл бұрын
You should be arranging your work well Great work btw
@DulajMiuranga10 жыл бұрын
Thankzzzzz a lot
@xs7327 жыл бұрын
You're hilarious Bucky and you sound like JMSN
@dibbiepk12 жыл бұрын
IF AND ELSE! WHOO! (I already know all about this, still) I wonder what the next one is =D
@Bigdamndawg3 жыл бұрын
U r a BEAST
@TheSplendidSpiders12 жыл бұрын
I wish I could get a raise from an if statement.
@adkadatka2449 жыл бұрын
#include using namespace std; int main() { string a; int b; cout > a; cout > b; if (b
@Brainimplodes9 жыл бұрын
Nice but could use some tidying up like aligning both "cout"s in the if/else statement for easier readability. Also like in Bucky's video, I'm personally like the look of my first curly bracket being in the same line as my "if/else" instead of going to a new line.
@xXLanyuzAnlunXx8 жыл бұрын
+adka datka use void int main { }
@xXLanyuzAnlunXx8 жыл бұрын
ikr :D
@adkadatka2448 жыл бұрын
***** I wrote it on code::blocks #getRekt
@habbo1597 жыл бұрын
lmao
@engrxtianbautista7 жыл бұрын
You're 30 years old by now.
@bakat24545 жыл бұрын
29 people disliked because they’re over 178 years old and they’re offended
@Subakak6 жыл бұрын
You could type in a cin command
@REALCOOLLIKEVIPUL12 жыл бұрын
Why KZbin gives me error when i try to paste code? How do you guys do it?
@meganathansubramani207011 жыл бұрын
Is there any way to print one cout statement 10 times?
@shadidhaque751811 жыл бұрын
i was trying to combine switch and if together but getting errors...help.plz..
@archavez10011 жыл бұрын
KZbin won't let me post it. I'll PM you.
@krishsabori68037 жыл бұрын
How we can make if else statements to show vowel and consonant letters