Buckys C++ Programming Tutorials - 14 - Constructors

  Рет қаралды 1,113,868

thenewboston

thenewboston

Күн бұрын

Пікірлер: 792
@Lescopardi
@Lescopardi 9 жыл бұрын
Bucky's shameless typos are what keep me coming back for more.
@eyalpery8470
@eyalpery8470 8 жыл бұрын
Humans are attracted to confidence, this is why it's true! heh
@user-tv8cu6uk5u
@user-tv8cu6uk5u 8 жыл бұрын
Hi, you might ask why I have contacted you.It is because I am also Christopher Holder .We Christopher Holders need to stay together.Even though you might think this is not real .It is.But I understand your doubt,because that is part of being Christopher Holder.Our duty is to find others like us.For the future of Christopher Holder.
@Lescopardi
@Lescopardi 8 жыл бұрын
Magnus such Christopher. Much Holder.
@theseangle
@theseangle 4 жыл бұрын
@@Lescopardi hold my Christ of Yerr
@ataladin87
@ataladin87 3 жыл бұрын
@@user-tv8cu6uk5u what the hell did I just read??.
@robertburbulea8503
@robertburbulea8503 3 жыл бұрын
7 years ago, before high school, this playlist turned my life towards programming
@jonsierra723
@jonsierra723 9 жыл бұрын
I understood this in 8 minutes and I couldn't understand in 2 hours of class.
@iosonoi.7132
@iosonoi.7132 6 жыл бұрын
Stupid professors don't know to teach. I hate going to class.
@vjosanazeqja5814
@vjosanazeqja5814 6 жыл бұрын
omg, same :|
@starinsky2873
@starinsky2873 6 жыл бұрын
And in sololearn takes 20 min lol
@shutdahellup69420
@shutdahellup69420 5 жыл бұрын
@Bo Ko idk man
@tuck582
@tuck582 5 жыл бұрын
Three years later I just had the same experience as you...
@jasonhogan8286
@jasonhogan8286 10 жыл бұрын
These videos have helped me out a lot! I have been able to go through 14 videos in less than 2 days and completely understand everything in them!
@bryanswaggbeast8194
@bryanswaggbeast8194 8 жыл бұрын
Ikr i thought i would never learn c++ but now I understand a little!
9 жыл бұрын
"What's even dumber than Lucky Bucky Roberts?" - Bucky Roberts
9 жыл бұрын
***** don't ruin it! It's just a quotation of what he said..
@xkilla911
@xkilla911 6 жыл бұрын
going to class for 2 hours and not learning anything vs watching this video for 8 minutes and learning everything.
@alexmrt6803
@alexmrt6803 7 жыл бұрын
"Pretty cool huh?"
@theseangle
@theseangle 4 жыл бұрын
Cool
@thechiller8211
@thechiller8211 4 жыл бұрын
Still cool asf
@jovandjokic4211
@jovandjokic4211 3 жыл бұрын
Crazy russian hacker
@ishowhalal
@ishowhalal 3 жыл бұрын
almost was gonna type same comment
@jaabirahamedsaleem1112
@jaabirahamedsaleem1112 2 жыл бұрын
@AlexMrt DaveHacks?
@gabinversace333
@gabinversace333 6 жыл бұрын
This guy had just explained in 8 mins what my book does in 107898 pages that’s how it should be brief and direct good job man
@mohamedel-hadidy4844
@mohamedel-hadidy4844 5 жыл бұрын
Dude,I'm a student in computer engineering school and believe me you're way better than my professor I've been using your tutorials for more than a year either for learning new things or revising and actually you're the BEST
@theyoungone2409
@theyoungone2409 10 жыл бұрын
So with a constructor, you basically give your variables a default value?
@yu-jyetung7730
@yu-jyetung7730 10 жыл бұрын
yep.
@ClaudiuB
@ClaudiuB 7 жыл бұрын
yep, that's why it's called a constructor :)
@chrislee4531
@chrislee4531 6 жыл бұрын
but what's the difference between that and initializing a value to a variable?
@technicalguy5668
@technicalguy5668 5 жыл бұрын
what is the value of default then?
@weou11
@weou11 4 жыл бұрын
@@technicalguy5668 null
@GimliSonOfGloin737
@GimliSonOfGloin737 8 жыл бұрын
Bam wam thank you ma'am. best
@enduringwave87
@enduringwave87 4 жыл бұрын
Mam needs a BAM WAM
@MNiTwInInG
@MNiTwInInG 12 жыл бұрын
Guys, Watch this Video ALL the times you think are necessary until you fully Understand. I watched it and Replayed it about 20 times, Worth It!
@Thatoneskymember
@Thatoneskymember 2 жыл бұрын
These videos are so much more helpful to me than reading all the blocks on code with comments on other websites
@russelljames7303
@russelljames7303 10 жыл бұрын
automagically, best, word, evar!
@bryanswaggbeast8194
@bryanswaggbeast8194 8 жыл бұрын
No bro it's automaticalyl Lol
@zeroisgawd1442
@zeroisgawd1442 7 жыл бұрын
Correction to both of you "this will get printied automagicalyl"
@jmr2008jan
@jmr2008jan 8 жыл бұрын
For those confused, constructors allow you to assign a objects member a value when you create the new object, instead of assigning the value in the definition. YOU CAN NOT ASSIGN MEMBER VALUES IN THE CLASS CONSTRUCTOR AND THE DEFINITION! This is a important point. You must decide if you want to assign values in the definition or the constructor. If you assign the members a value in the definition objects created from that class will always have that value when created. Constructors allow you to assign a different value at object creation. In addition, constructors can set the values of private members not just public. You otherwise can not set private values from outside the class. Friend functions being a special case that I won't get into.
@Collegesheriff
@Collegesheriff 11 жыл бұрын
pretty much, yes, you can have many constructors, and depending on how values are given to a class object, it will choose the appropriate constructor to set those values.
@fernando3061
@fernando3061 8 жыл бұрын
The way he explains things just make sense, clears so much confusion.
@Tazmondo
@Tazmondo 9 жыл бұрын
"If someone puts cout inside a constructor then slap them round the face because they're an idiot." - Bucky Roberts 2015
@riaafridi3599
@riaafridi3599 7 жыл бұрын
one thing i like most about bucky lectures that he deliver the best concept in short time
@administrator5047
@administrator5047 10 жыл бұрын
Love your videos! Anything that I don't understand from a book I come here and you answer all my questions with your videos.
@tiaanadlem
@tiaanadlem 3 жыл бұрын
Great explanation. You have a great talent for explaining. I have been watching a few videos on C++ object orientated programming. You explain it the best by far. Keep up the great work bro
@MarijnKonings
@MarijnKonings 11 жыл бұрын
I had that at first as well, just keep researching on google and keep watching the video over and over again till you understand it to the point where you can explain it and it makes sense to you.
@TheSongbirdo
@TheSongbirdo 10 жыл бұрын
C++, a million different ways to make a .exe say something
@dashcampower4622
@dashcampower4622 4 жыл бұрын
How are u doing Fam
@hetaeramancer
@hetaeramancer 2 жыл бұрын
only a thousand
@nielsSavantKing
@nielsSavantKing 3 жыл бұрын
"if somebody prints something in the constructor you have to slap him on his/her head!!" Yaaaa, that is the talking!! I love it
@lawmsangivarte5076
@lawmsangivarte5076 3 жыл бұрын
XD
@Kickasss119
@Kickasss119 12 жыл бұрын
you explained in one video what my teacher, comprehensive book, and multiple online forums never could... thank you
@thanasis.malasidis
@thanasis.malasidis 9 жыл бұрын
Just saying but at 6:58 wouldn't this work even if the constructor override "Lucky Bucky roberts" with "Sally mcSalad" ? To show that each object has it's own value for name wouldn't it be necessary to call bo.getName(); after creating the second BuckysClass object, to demonstate that the second object did not change the variable of the first object ? Anyway, I really like these tutorials and as I am coming from C# I find them pretty easy. Thank you Bucky for the tutorials!!
@FingersBlazin
@FingersBlazin 8 жыл бұрын
This lesson is hard but worth it. I had to go over it many times and type it into codeblocks, write it out on paper and take notes, then write it out a second time with additional notes. People are asking a lot of questions because they are not looking at it long enough. Slow down and take in each sentence, repeat it over and over till u get it :)
@L8onL8on
@L8onL8on 6 жыл бұрын
Thank you, this helped make the difference on an assignment of mine this week that I was previously lost on!
@XBR4Da
@XBR4Da 9 жыл бұрын
why hasn't Google hired me yet?
@jigglywiggly6479
@jigglywiggly6479 9 жыл бұрын
XBR4Da He doesn't like to work for sm1 else... He is just his own master... Check out his vlog where he said that.. :))
@samm4885
@samm4885 9 жыл бұрын
Marshall Mathers He said "me" not "Bucky" smh
@XBR4Da
@XBR4Da 9 жыл бұрын
***** he prefers working independently i think
@nishantgurrapadi
@nishantgurrapadi 9 жыл бұрын
+Jordan Filipovski this comment made my day
@ibiixie
@ibiixie 9 жыл бұрын
+Marshall Mathers He works at google, at least according to his website.
@Wraki123
@Wraki123 6 жыл бұрын
Wow. I know this is a super old video, but just wanted to extend my thanks. Just started watching these and all the gibberish my prof has been saying is finally making sense:) thank you!!!!
@trakeC
@trakeC 4 жыл бұрын
OMG thats what ive been doing wrong. I need to stop putting random words in the middle of my programs. Thank god for bucky roberts
@steam_vortex2608
@steam_vortex2608 8 жыл бұрын
You're an interesting guy Bucky; I love your videos and you're a great teacher, but I find it funny that you never type your cout messages in any literate context. Do you do that on purpose as a joke or are you doing it by accident? In either case it's funny as hell; you're a great coder and quite good at explaining things so it doesn't diminish what you're teaching at all. In any case thanks for posting these vids; I've already learned quite a bit from you. Keep doing what you're doing; cheers!
@PflanzenChirurg
@PflanzenChirurg 8 жыл бұрын
Agree :D
@roushangiri4722
@roushangiri4722 8 жыл бұрын
Actually he does it because fro some lads computer programming is already so boring with hell lot of commands so he tries to make it interesting and also funny by give such remarks in his cout statement....
@PflanzenChirurg
@PflanzenChirurg 7 жыл бұрын
hahaha if ur skill stucks on a level it can get boring but its ur choice
@Amirzaki007
@Amirzaki007 6 жыл бұрын
well some people are kinda forced to take it as a part of their degree!
@PoptartChris
@PoptartChris 6 жыл бұрын
Whenever I'm coding I'll always type something flippant instead of making real text like Bucky. For example, while I'm testing a program I just use strings like "poopgod6969"
@iiN1GH7M4R3ii
@iiN1GH7M4R3ii 6 жыл бұрын
"So remember not to put words randomly in the middle of your program or it won't run" ..... very insightful Bucky! For real though, thank you. Great video.
@TheRecocebo
@TheRecocebo 3 жыл бұрын
Thank you. You are the most Clear teaching Man of them all. With pretty cool accent and not doing showing off like the rest do.
@osamarizwan7874
@osamarizwan7874 6 жыл бұрын
Instead of using constructor to just set name, it is already done by setname function. We can optimize the code by just writing name = x in constructor. And the cout setname
@togmeister8604
@togmeister8604 9 жыл бұрын
2:44 everyone must now slap Bucky. Lol. You are writing in the constructor.
@n3onis
@n3onis 7 жыл бұрын
Again, perfect. Constructors were another topic I couldn't get through completely.
@franciscopestana967
@franciscopestana967 10 жыл бұрын
I've started watching your videos last week and i've be able to improve a lot my newbie programming skills. Thanks a lot :D. Btw, if anyone wants to do some exercices (they helped me): Exercise 1: Write a class Square which has a field for side. It must have a constructor to initialize the side. Add methods to the Square class to calculate area and perimeter. Exercise 2: Write a class Circle which has a field for radius. It must have a constructor to initialize the radius. Add methods to the Circle class to calculate area and perimeter.
@alexandrac4582
@alexandrac4582 6 жыл бұрын
Thank you for the exercises 🙏🏻 😊 ☺️
@lfethacarter
@lfethacarter 7 жыл бұрын
watched this video at least 4 times, finally got the gist of it.
@MrEpicSpace
@MrEpicSpace 8 жыл бұрын
I feel like an old person when I code in C++.
@normallytangent
@normallytangent 8 жыл бұрын
Okay, this is the first time I'm reading something called C++17. Your thoughts?
@iihuayra4149
@iihuayra4149 8 жыл бұрын
+Chel Viz I feel the same and I had not even heard about C++14
@FingersBlazin
@FingersBlazin 8 жыл бұрын
Maybe because old people make game engines using c++? lolz
@Malluc
@Malluc 8 жыл бұрын
I thought that in video game coding c++ is still a prominent language that is used.
@Malluc
@Malluc 8 жыл бұрын
***** oh okay so what does that mean then? i mean you still have to code right?
@sylphid96
@sylphid96 8 жыл бұрын
that name in 5:10 appeared automagicalyl
@emmanuel55lionbear
@emmanuel55lionbear 8 жыл бұрын
2spooky4me
@bryanswaggbeast8194
@bryanswaggbeast8194 8 жыл бұрын
+Sir Jova im pretty sure your looking at this video for making a sprx mod menu for gta 5 right? i know 2much4u!!!!
@emmanuel55lionbear
@emmanuel55lionbear 8 жыл бұрын
Bryan SWAGGBEAST :O
@fwesh1
@fwesh1 13 жыл бұрын
A good example of classes and objects is Pokemon. Pokemon would be a class with a general set of attributes that a Pokemon would have and a specific Pokemon (Pikachu for instance) would be an object of the Pokemon class that has the Pokemon template but with a bunch of specific values that make Pikachu a unique Pokemon. Then you would have other Pokemon objects, Charmander, etc. objects with the same Pokemon template but with different values for the variables. Thumbs up so others can see.
@isrj01
@isrj01 11 жыл бұрын
you deserve some beers for all these tutorials
@GretoDaBoss
@GretoDaBoss 11 жыл бұрын
Thanks bro, exam tomorrow and just decided to look up Constructors on KZbin and came across your channel...definitely subscribed now.
@ThePaniniboy
@ThePaniniboy 12 жыл бұрын
If it helps, whenever I think of objects and classes and constructors I think of a game with monsters.Let's say we have a class is called makeMonster. It has a constructor that takes three parameters, a string, an int, and an image. To make it easy on the programmers, instead of having to set each of these individually for each and every monster they can do something like: makeMonster snail("snail",50,"snail.png") instead of snail.setName() snail.setHP() snail.setImage() to make the monster.
@TheKiloOhm
@TheKiloOhm 8 жыл бұрын
Why in the constructor function you can't just say name = z? If the constructor is inside the class can't it just use the variable?
@dibbiepk
@dibbiepk 12 жыл бұрын
2:40 "If you see anyone printing something out on the constructor, then there an idiot, and you should slap them upside the head" LOL!
@djsmurfen
@djsmurfen 11 жыл бұрын
Bucky, when i graduate and get my first job I'm gonna donate a shit load of money to you.
@jbbauer0
@jbbauer0 13 жыл бұрын
Starting to get to the point where the stuff were learning could have some real uses in programming. I wish you had made a video around this point that would combine everything from the last 14 videos, and make a cool little program. That is why school helps you remember stuff better, is because the homework and projects etc. I guess I am going to have to think up a little "project for myself to do with everything ive learned so far.." Thanks for making these videos!!
@dmaster20ify
@dmaster20ify 7 жыл бұрын
Thank you Bucky now I make sense of constructors. What is a destructor (~)? Does it destroy the data we automatically gave the object?
@dimashur
@dimashur 10 жыл бұрын
the first time i've encountered classes and constructors i was like no thank you, fuck programming. but once you program long enough you start to appriciate how organized everything is
@Rahoomba
@Rahoomba 11 жыл бұрын
If you're confused by these class things, just keep on going until he starts using them a lot more again. Eventually you'll just be like "wow, I need to try understanding this again." I got to tutorial 50, personally, and watching this a second time around makes a world of a difference. I understand now.
@Fullstackdev-
@Fullstackdev- 3 жыл бұрын
one of the best teachers on the tube
@AnOldSchoolG33K
@AnOldSchoolG33K 10 жыл бұрын
Now would've been a good time to introduce the term "Instance". bo and bo2 are each distinct instances of the BuckyClass object. The form and function of each are identical, but the values may (but don't have to be) different. Example: You have a class named Person you can have multiple people by reusing the same class... Person p1("Me"); Person p2("You"); We are 2 separate people, but we both have names, dates of birth etc.
@tanzimmostafa
@tanzimmostafa 6 жыл бұрын
why cant u write z=x; instead of setName(z); also how come writing setName(z); works , setName was not defined first but rather later,so this should give an error.
@yugu6086
@yugu6086 5 жыл бұрын
I'm also confusing about this, do u figure it out?
@tanyichun2535
@tanyichun2535 4 жыл бұрын
Basically, everytime you wanna introduce a variable, you'd have to do " int a " or " string x " right? but for this case, x is a paremeter and not a variable, same with z. So you can't just say z = x at the constructor, would be fine for z = 'something else that is defined', same case as "name = x" since name is already defined with " string name" at private and x is the perimeter, but although z is a paremeter, x isn't defined.
@parzingtheasian
@parzingtheasian 6 жыл бұрын
every time he says "lucky bucky roberts" drink a shot Edit: also drink a shot every time he says "sally mcsalad" i followed my instructions and now im drunk XD
@VarunSharma-vc1yu
@VarunSharma-vc1yu 3 жыл бұрын
"pretty cool huh?"
@JohnMarkIsaacMadison
@JohnMarkIsaacMadison 9 жыл бұрын
@0:55: Constructors do not have return type. @1:03-1:21: Constructor Name == Class Name. Always. @1:42: cout
@ashwanisinghtanwar2915
@ashwanisinghtanwar2915 9 жыл бұрын
in name = x we have not defined "name", how come its not showing error... Please xplain
@pranavbanerjee8625
@pranavbanerjee8625 8 жыл бұрын
It's defined in private dduh
@sattikhalder
@sattikhalder 7 жыл бұрын
Bucky is best he even leaves source code for us
@racheljeehye
@racheljeehye Жыл бұрын
HALLELUJAHHH!! the sun is shining the Church doors have busted open. You've helped me understand some serious misconceptions... thank you thank you
@AxelWerner
@AxelWerner 12 жыл бұрын
Awesome inSHtructions! i like the SHTRING passing the most.
@MadOgre22
@MadOgre22 12 жыл бұрын
Actually, I print stuff in the constructor all the time. I do it as part of the debugging process. When I write big programs that use RAII and there are a lot of objects being created. Sometimes the best way to make sure everything that was created got deleted correctly is to have it print the debug information to the console. Obviously this stuff is later removed in the final program.
@TwoLazyTurtles
@TwoLazyTurtles 11 жыл бұрын
Thanks bucky, Im reading "C++ Primer" the section on constructors was hard to understand. I watch your video tut and with one line it all came together "A constructor is a function that gets called automatically as soon as you create an object." Simple.
@sidharth.1952
@sidharth.1952 5 жыл бұрын
I'm reading primer too Just started it Is it worth reading? Pls give your opinion
@sandy1995
@sandy1995 9 жыл бұрын
Your examples are amazing! Great Work Sir Bucky!
@SportGrounds
@SportGrounds 6 жыл бұрын
I love your teaching style Bucky!
@rafaelermel
@rafaelermel 11 жыл бұрын
I love how you pause everytime between the words "Lucky (..) Bucky (...) Roberts!" XD
@priyansh1210
@priyansh1210 9 жыл бұрын
SIr, In your 43rd tutorial on deconstructors, you said that deconstructors can't return a value and can't have a return type. I want to ask that can a constructor have a return type(void,int.etc) or can it return something?
@kyuyoungshim9940
@kyuyoungshim9940 7 жыл бұрын
A really good demonstration...You are just amazing
@ViceSyndicate
@ViceSyndicate 10 жыл бұрын
Does it matter wich order you write the code in " BuckysClass " ? Could you first set " String name; " to private and then do the public functions to acces name?
@TheAsphixiator
@TheAsphixiator 10 жыл бұрын
Yes. You can do that. It's the same thing.
@voltaquake
@voltaquake 13 жыл бұрын
@valid4ever Yes that is true, once you make the object and pass it a string, then the name will be that string. However, sometimes you may want to change the name in the middle of the program and so with the setName function, you can still change it.
@ChillzYouTube
@ChillzYouTube 7 жыл бұрын
6 years ago this sexy video was uploaded.
@hershsangani9302
@hershsangani9302 6 жыл бұрын
Anyone else hear Charlier (Trip) Tucker III's voice from Star Trek: Enterprise? This is what Trip probably did before he left for star fleet...Thanks, great video!
@taylorclark5485
@taylorclark5485 9 жыл бұрын
Bucky, you're hilarious. Definitely make boring material enjoyable!
@haroldmcbroom7807
@haroldmcbroom7807 2 жыл бұрын
A note on cin... // cin extraction stops reading as soon as it finds any blank space character cin >> fnam; // using getline offers a solution to this problem. *(see below please)* string mystr; cout
@jemaiwadhah6423
@jemaiwadhah6423 8 жыл бұрын
Buckys make it so easy to understand
@matthewnaylor5894
@matthewnaylor5894 8 жыл бұрын
When using a constructor to set initial variables for an object, does the constructor really need to use the public functions in order to do so? (analogy time: Isn't this like an employee using the customer bathroom instead of the employee bathroom?)In theory, couldn't/shouldn't the constructor just set the values for the variables directly since it's within the class? Also, does the constructor need to be in the public part? Thanks.
@wejnc
@wejnc 9 жыл бұрын
Hi just a quick question, isn't BuckyClass(string z) : name(z){} the best way of doing this? That way variable will be written once instead of twice and also will be useful for const and reference member.
@inspiredchild232
@inspiredchild232 9 жыл бұрын
Hey Bucky, I have been watching your vids and I'm loving em. Thumbs up! I have a concern though. At 2:24 you called "bo" an object which it is of the class BuckysClass. However, at 3:48 you call it a constructor by saying a constructor can have a parameter. I'm confused! Did you mean an AN OBJECT can have parameters or a CONSTRUCTOR (because "bo' isn't a constructor)?
@axtyab969
@axtyab969 9 жыл бұрын
I believe the constructor acts as a way to give paramaters directly to a newly made object. bo is an object, but because the constructor inside BuckysClass asks for a string paramater, you pass it a string through the bo object. But if im wrong, please correct me.
@ThePositiev3x
@ThePositiev3x 9 жыл бұрын
since the name of the class and the name of the constructor are same and once you create an object you automatically call constructor function, he said so
@dibbiepk
@dibbiepk 12 жыл бұрын
Hey, QLHanz, Im a bit new to programming myself, and yes, as you move forward through this stuff, it will get more harder, but in reality, it really isnt THAT hard, just replay the vid a few times until you fully understand it, then and only then will you be able to advanced to the next video, young patawon, or programmer in this case :P
@KARAB1NAS
@KARAB1NAS 8 жыл бұрын
the function "setname" is defined below the constructor. why the compiler still compiles that? I would expect the function to have been defined before the constuctor for the compilation to work...
@FingersBlazin
@FingersBlazin 8 жыл бұрын
Everything happens in order. main() runs first, sees BuckysClass, and passes the parameter "Lucky bucky roberts" to the constructor. Then the constructor uses the function setName to assign the parameter "lucky bucky roberts" to the name variable. Then it goes back to
@Elegyofawesomeness
@Elegyofawesomeness 7 жыл бұрын
What he says about objects is SUPER important. Remember, you're creating an instance(copy) of the class, NOT a link to the class itself.
@muhdfaizal6726
@muhdfaizal6726 9 жыл бұрын
Helped me a lot! Cheers Bucky!
@0x1EGEN
@0x1EGEN 7 жыл бұрын
Is there a way to loop through an array containing classes with inheritance? Like lets say I have a "super" class named "A" and create subclasses that extends A named "B" and "C" and suppose that they have different methods. and so if I create an array of classes "A" and put elements that are from "B" and "C", that would mean that each elements in it are different byte sizes, meaning I can't use for (int i=0; i
@icebreakerek
@icebreakerek 2 жыл бұрын
Take a drink everytime he says "Lucky Bucky Roberts".
@ammarqs
@ammarqs 9 жыл бұрын
HI bucky, Thank you very much for these awesome courses you are providing on your website and on youtube. I would like to know if there is any book you would prefer as a reference guide while doing C++. Something that you would use as a reference and learning guide. Thank you
@awesomelemonade
@awesomelemonade 12 жыл бұрын
I opened the program exactly when bucky did!
@JamesBrodski
@JamesBrodski 4 жыл бұрын
Great video as always! I learned a lot. Thank you very much.
@ShaunMunsey
@ShaunMunsey 10 жыл бұрын
These tutorials are excellent, thank you!
@prvnpn216
@prvnpn216 11 жыл бұрын
Thank you for saving me from digging into books for hours... Lotta love:D
@alexgomes9680
@alexgomes9680 6 жыл бұрын
Can you not set the 'name' to a string inside of the constructor without using the function 'setname'? As far as I know, the private variable can be accessed by the constructor. Any help is appreciated, thanks!
@kingjbc1
@kingjbc1 11 жыл бұрын
Well they do you different compilers on default sometimes. Visual Studio 2010 for example uses the VS 2010 Compiler and Codeblocks uses Mingw, but these can all be changed with relative ease.
@rinkusamanta1065
@rinkusamanta1065 6 жыл бұрын
2:43 i slapped my techer coz of bucky
@pastitsio
@pastitsio 7 жыл бұрын
So, are the functions in public section of code created in parallel? Because sequentially the constructor is created before the "setName" function, yet it is used in the constructor. Also, the setName function is not prototyped.
@nightprogrammer7474
@nightprogrammer7474 8 жыл бұрын
bucky i have a question does anything change if i dont set my function and string to get" " and set" " or it definitly has to be Get " " and set " "
@pacochamorro-fierro122
@pacochamorro-fierro122 5 жыл бұрын
is it possible to have more than one constructor to handle exceptions? Let's say I have an Object1(string, int) and I have Objetc2(string, float)
@hwudiwkbwhsysiwkmwbsoslkwaauyy
@hwudiwkbwhsysiwkmwbsoslkwaauyy 10 жыл бұрын
For mac users, I reccomend using the eclipse C++ plugin, it's really good, and works a tonne better than Code::Blocks for mac.
@TWolfguarde
@TWolfguarde 11 жыл бұрын
Not so much. It's more a thing of consolidating what you already know. It's tempting to just power ahead (I do it, even though I shouldn't), but you'll probably learn a lot more, a lot faster, if you sit down after every few tutorials and look over your code, work out what you can do with it, and write a couple of simple programs of your own without the tutorial to help. Working on your foundations will make learning the rest a lot easier.
@Qazqi
@Qazqi 11 жыл бұрын
std::cin is an object that represents stdin, not a function. The >> part is the function (which overloaded operators are) that reads in data.
@A7medMSD
@A7medMSD 7 жыл бұрын
1:03 "and the constructor name is always the same as the class name ,the exact same " - Bucky the Rapper :p
@lenzpaul2205
@lenzpaul2205 5 жыл бұрын
Clear and concise 🙏🏾
@r34p3r_here
@r34p3r_here 4 жыл бұрын
You saved my life bro awesome stuff!
Я сделала самое маленькое в мире мороженое!
00:43
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 122 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 275 #shorts
00:29
How it feels when u walk through first class
00:52
Adam W
Рет қаралды 25 МЛН
Buckys C++ Programming Tutorials - 13 - Using Variables in Classes
9:12
thenewboston
Рет қаралды 1,1 МЛН
Buckys C++ Programming Tutorials - 35 - Passing Arrays to Functions
7:59
Buckys C++ Programming Tutorials - 52 - Inheritance
7:56
thenewboston
Рет қаралды 470 М.
Buckys C++ Programming Tutorials - 20 - Sentinel Controlled Program
9:41
Buckys C++ Programming Tutorials - 38 - Introduction to Pointers
6:07
Buckys C++ Programming Tutorials - 25 - switch
7:24
thenewboston
Рет қаралды 428 М.
Я сделала самое маленькое в мире мороженое!
00:43