For people following the playlist, video 21 and 22 are missing. Here are links to those video's :-) 21: kzbin.info/www/bejne/qnjJk5-MbsxoobM 22: kzbin.info/www/bejne/h3iYpGdofsRqa8U Have fun!
@ChristopherJones169 жыл бұрын
16:58 lol gotta love our dogs letting people know this is THEIR turf and that person picked the wrong street to walk down. Dogs are so gangsta lol.
@ChristopherJones169 жыл бұрын
Btw video 21 and 22 are missing from your playlist for c++ but you probably knew that already. I'm guessing it's the polymorphism tutorial.
@winkalxy10 жыл бұрын
Your the best of best !!! Thanks alot mate
@ChristopherJones169 жыл бұрын
So setting a child class inheritance access to private (class : private ) means it'll inherit public from parent but make the public members and methods private in the child's class. So in other words this is done to keep other classes from inheriting from that child class?
@NevenaPerovic10 жыл бұрын
Hey dude, I watched your Tute about Constructors and Destructors yesterday, where you created several classes - Town, Houses, People and linked them together using defined types of objects...Could you please make a comparison between that procedure and inheritance? :) What's the benefit of the later one? How can I access all the members in the previous procedure (not the inheritance), as it is super clear how I can do it here with inheritance. Thanks a lot! Cheers!
@WhatsACreel10 жыл бұрын
Morning, that's a good question! When you add a member variable to a class you are making a “has” relationship, houses have people, towns have houses etc. When you inherit from a parent class, you're creating an “is” relationship, a house is a building, a bee is an insect etc. Inheritance and member variables model two subtly different things. It might help to forget about the English meaning of the word Inherit. In C++, when you inherit it doesn't mean you “own” something, it means you “are” something. The difference is you can add multiple member variables of the same class, but you can't inherit from a class more than once. So, you could make a House class contain 100 People objects where the People are all member variables, a house can “have” or “own” 100 People. But with inheritance, you either inherit once or you don't. You could make a House class inherit from a Building class but you can't make a House inherit from the People class 100 times. At least that's not what inheritance is designed for. Also, inheritance allows polymorphism. We can create a Bird class which inherits from an Animal parent class. Then we can pass objects of type Bird to any methods which ask for Animal parameters. Anything Animals can do and have, Birds can do and have as well. We can treat any Bird as an Animal because a Bird is an Animal. Whereas, if a Bird has Wings as member variables, then Birds can call the public member methods of their Wings. They could call Wing.Flap() or whatever. But, a Bird object cannot be passed to a method which requests Wings as its parameter. If a method requests a Wing object as a parameter, it doesn't make sense to pass a Bird object when you call the method. Birds are not Wings even though Birds do have Wings. I hope this helps, thanks for watching and commenting and have a good one!
@NevenaPerovic10 жыл бұрын
Hi :) Thanks a lot for the answer! It helped indeed a lot!!! Now I got that slight difference and I am going to test it using different examples, so to be sure that I understood you correctly. All the best and keep making such great videos ;) Cheers!
@ChristopherJones169 жыл бұрын
_getchar() is new to me. Is that similar to system (pause)? Or getline I think it was I saw in the one guys tutorial
@heeseung57 жыл бұрын
Great explanation!
@randomthecoelho436810 жыл бұрын
could you make a video only about game programming? using everything you taught, but only for games?
@suibora10 жыл бұрын
you went over it briefly but i still don't understand what it means when a class 'publicly' inherits from a parent class, the numbers mason, what do they mean?
@WhatsACreel10 жыл бұрын
Yes, sorry about that. I was not being very clear. I might have made the term up? Anyway, let me try and sort it out. When you inherit from a parent class, the parent will have a bunch of public members (maybe protected members as well). But the child class doesn't have to make them public when it inherits them. It can inherit them privately. That would mean that, although the members are public in the parent class, in the child class they are private. When I said "publicly inherit", I just meant that the child class used the "public" keyword in the inheritance. So anything public in the parent is also public in the child, and anything protected remains protected. It's actually a pretty strange mechanism, one of the many odd quirks of C++. I've never used anything but "public". I can imagine where you might use "private", but honestly it's not very useful. Stick to public and you're right as rain. Hope this helps, cheers!
@suibora10 жыл бұрын
thank you again, keep up the good work
@ChristopherJones169 жыл бұрын
+What's a Creel? I was told one should make everything private as possible. That public allows for possible problems in the future with user changing code and the such.
@facebren6 жыл бұрын
You are so charming, my dude
@WhatsACreel6 жыл бұрын
Hahaha, thank you WorldParticles, you're charming too evidently!
@OssaGhalyoun8 жыл бұрын
Good series indeed thanks. I am so glad the Chihuahua was stuffed otherwise you would have been poorer than shkit hahaha. And by the way wait for my invention of new inheritance model based on real life experience, parent instantiate a child and sets up a reverse inheritance, I will call it slurp_back constructor, hahahaha :-)