Buckys C++ Programming Tutorials - 57 - Abstract Classes and Pure virtual Functions

  Рет қаралды 308,485

thenewboston

thenewboston

Күн бұрын

Пікірлер: 224
@andrewyounan9157
@andrewyounan9157 10 жыл бұрын
Bucky youre a legend
@vu5700
@vu5700 4 жыл бұрын
Its been 6 years since you wrote this comment,did you become a professional programmer?
@gutoguto0873
@gutoguto0873 4 жыл бұрын
no
@danyfour7754
@danyfour7754 3 жыл бұрын
@@vu5700 I hope so
@ISLAMguidanceful
@ISLAMguidanceful 7 жыл бұрын
the difference between Buckys and most professor in elite universities is, he actually wants to help you. his trademark isn't knowing c++ as much as it is his sincerity, hats off to you sir.
@neoslink1
@neoslink1 10 жыл бұрын
Your videos are literally the best. My CS2 teacher is garbage, and after every lecture I run back to my room to look up one of your videos on the subject. You're the only reason I'm passing this class rn XD
@pranjalshukla8096
@pranjalshukla8096 9 жыл бұрын
+Ben Cicotte same here you've been great help. keep this up man
@SirRobbStarkGamin
@SirRobbStarkGamin 10 жыл бұрын
what my prof wasn't able to teach me in 1.5 hours you taught me in 7:40 mins. You sir are a BAMF.
@AdityaFingerstyle
@AdityaFingerstyle 7 жыл бұрын
You just paid more attention to this video.
@ArslanAli-cs1be
@ArslanAli-cs1be 7 жыл бұрын
he made us pay attention
@AV1461
@AV1461 7 жыл бұрын
Typical :D. I'd say that is why it is important to study on your own. Same thing could happen the other way around: If you watch this video first and didn't understand, then you could have your teacher teach it and you would understand then. Having two very different contexts teach you something is very effective at highlighting what's important. So, go to classes, read books, watch videos, etc..
@TheAvekat
@TheAvekat 3 жыл бұрын
Greetings from AU Software Bachelors, in Denmark. Would just like to thank you Bucky. Our teacher is linking to your videos if we prefer videos over books, which most of us do. So you're basically a university teacher :D
@hashmatullahhassani2825
@hashmatullahhassani2825 5 жыл бұрын
Hi Bucky, I am watching your videos more than 3 years, I found no body at explaining logic points better than you. whish you more successes, keep shining well.
@AdityaTiwari-le9oe
@AdityaTiwari-le9oe 3 жыл бұрын
Listening to your videos in 1.5 is a fun and fast way to learn. Thanks for your tutorials.
@malaki7123
@malaki7123 11 жыл бұрын
Hey Bucky. I' started watching your tutorials about 2 weeks ago to help learn a new programming language along with my Java, and I've gotta say that I've learned a heck of a whole lot of stuff here that I've been able to use to understand all that other stuff, and I absolutely love C++ now. Thanks a lot!
@CraftySidd
@CraftySidd 3 жыл бұрын
So, just wondering. Where are you in life right now?
@jordanmakesmaps
@jordanmakesmaps 6 жыл бұрын
I love it when I don't understand some aspect of syntax for c++, and when I search for it on KZbin, I see thenewboston as the first video. It's gonna be a good day.
@muffinspuffinsEE
@muffinspuffinsEE 9 жыл бұрын
Your voice is perfect in 1.25 for people in a hurry :) :D
@kylethorburn5038
@kylethorburn5038 9 жыл бұрын
+muffinspuffinsEE lol, i always listen in 1.25 : p
@ChucksNourish
@ChucksNourish 9 жыл бұрын
+Kyle Thorburn Im almost tempted to do 1.5 lol
@yoteango
@yoteango 8 жыл бұрын
+ChucksNourish Every day 2.0
@ke9n
@ke9n 7 жыл бұрын
I listen in 1.5
@danieldinh9911
@danieldinh9911 5 жыл бұрын
yoteango 2.0 for the procrastinators
@bern1223
@bern1223 4 жыл бұрын
For years I have never understood the point of pure virtual functions, but I was able to understand the significance of it because of you in under 8 minutes. Thanks Bucky!
@giancarloandrebravoabanto7091
@giancarloandrebravoabanto7091 5 жыл бұрын
Im in love with C++ even more. old is gold my friends
@nc8024
@nc8024 7 жыл бұрын
I really appreciate your channel. I spent hours reading stack overflow, professors lecture slides, and google trying to understand polymorphism and pure virtual functions. You explained it in a few minutes.
@AssassinGrudge
@AssassinGrudge 10 жыл бұрын
somthing importan bucky : you cant create an object with a Abstract classes : i mean if u did this Enemy Object; it will not work we can just create pointers
@Muzzletainment
@Muzzletainment 6 жыл бұрын
I didn't understand at the beginning but after you explained it multiple ways and repeated some info it clicked! Thank you!!
@mddilshadislam6617
@mddilshadislam6617 6 жыл бұрын
Hey Bucky.. Your vedios are inspiring and a gate away to escape all of the issues of broken mind....... It's been quite a days I didn't code.... Coz I have been suffering some meaningless emotional issues...After all, these emotional issues are always seemed to be meaningless as usual.... So today I'm got my track back on starting abstract class.... Trying to forget all those things....
@Wiwiha123
@Wiwiha123 13 жыл бұрын
now it's 6:00 am and i have my first programming exam at 8:00am in virtual function and poklmorphism and the pure functions ... , thank u 4 this fast tutorial,really good one :))
@dosomething3
@dosomething3 5 жыл бұрын
wow. you made the simplest concept - into something that even I cannot understand. Hats off.
@preetigodara544
@preetigodara544 7 жыл бұрын
you r seriously a legend, i tried to understand it from so many sources but i couldn't nd now after watching this video it seems so damn interesting and easy
@tlhomotsemoteme2423
@tlhomotsemoteme2423 6 жыл бұрын
I can't stop laughing and giggling because you make my programming life so easy! Thank you so much.
@AndrewAmesbury
@AndrewAmesbury 13 жыл бұрын
Legend, queried 4 books 2 tutors and a friend but this finally made sense thanks to your short video.
@thethinker8717
@thethinker8717 6 жыл бұрын
Bucky whoever you are god bless you I only trust you on KZbin video for c++ ......you explain well dude
@mehrnazzhian1912
@mehrnazzhian1912 8 жыл бұрын
Amazing.Simple and understandable. Thank you
@abdannour26
@abdannour26 6 жыл бұрын
I don't think that i'll be able to learn anything without Bucky Roberts, :) :) :)
@MrKrillovski
@MrKrillovski 11 жыл бұрын
Thx for your videos. I didn´t understand anything of my homework until I´ve watched vid nr 56 and 57.
@SilenThps
@SilenThps 12 жыл бұрын
wow you explained this soooooooooo much better than my professor did. I sort of had a lightning bulb experienced and thought "OOOOOOOO thaaaaaaats why it's called a pure virtual function!"
@shradhajaiswal1562
@shradhajaiswal1562 8 жыл бұрын
thank u so much Bucky....u r just amazing....Ur videos actually help me to keep on studying computer science....all doubts a just cleared with Ur help...thank u so much...:-D
@trido3815
@trido3815 10 жыл бұрын
Buckys, you make it very easy to understand. thx
@romankantor1326
@romankantor1326 6 жыл бұрын
Your explanations are the best! Thank you for all the tutorials!
@puffbluesam021
@puffbluesam021 10 жыл бұрын
So much kindness Bucky!! Thank you! You really deserve some Tuna!!!!!
@jas4768
@jas4768 5 жыл бұрын
Bloody legend. Cheers from London, UK.
@khaledalhousa6687
@khaledalhousa6687 10 жыл бұрын
that one of the best in the c++ thanks
@jaunathang
@jaunathang 4 жыл бұрын
9 years later and this saved my semester
@majedalghanmi7429
@majedalghanmi7429 7 жыл бұрын
youre a legend youre a legend youre a legend youre a legend youre a legend youre a legend
@kiva8986
@kiva8986 7 жыл бұрын
for (int i = 0; i
@rushipatel4466
@rushipatel4466 7 жыл бұрын
you forgot to put i++ ;)
@jerichosharman470
@jerichosharman470 9 жыл бұрын
WOOOHOOOOO SUPER AWESOME VIDEO>>>>..well explained and thankyou
@abhinavs03
@abhinavs03 6 жыл бұрын
BUCKY! YOU ARE THE MVP BRUHHHHHH!
@ServusTuus.
@ServusTuus. 10 жыл бұрын
eres un chingon Bucky!.... eres mi gallo. Muchas gracias
@sheralikhtk5200
@sheralikhtk5200 5 жыл бұрын
Thank you so much now i can write something in my exams
@GoddamnAxl
@GoddamnAxl 8 жыл бұрын
good job on the teaching!! really love your vids and helped me a lot. It kills me to see that type "mponster" tho..
@tristanortiz4054
@tristanortiz4054 7 жыл бұрын
Jesus thank you man your stuff is amazing. Regards from canada
@yikes3796
@yikes3796 11 жыл бұрын
I learned more from this tutorial than my Professor.
@Shahzebnaeemminhas
@Shahzebnaeemminhas 5 жыл бұрын
Bro love your videos. Stay awesome mate 👍
@2fatb0y
@2fatb0y 10 жыл бұрын
I love these tutorials !!
@gba7613
@gba7613 12 жыл бұрын
Thanks ! a lot.. really we are gaining too much knowledge from ur tutorials ....
@TysonGill
@TysonGill 12 жыл бұрын
@emmanuelvelez8431
@emmanuelvelez8431 6 жыл бұрын
Thanks for made this videos, it helps me a lot
@bookdream
@bookdream 9 жыл бұрын
But I wanted another clam =/
@akashkedari255
@akashkedari255 Жыл бұрын
Hey bro a heartful thanks....May god bless you brother
@ziadhassan7
@ziadhassan7 8 жыл бұрын
I actually enjoyed the Polymorphism videos more than any thing ^_^
@rabimoshehizskiaavnergolde3195
@rabimoshehizskiaavnergolde3195 8 жыл бұрын
same it was easy XD
@danysvideos
@danysvideos 6 жыл бұрын
Thank you! Now I know the difference. Pretty easy!
@KW-dg6fs
@KW-dg6fs 7 жыл бұрын
So basically a pure virtual function is equivalent to not writing a function at all. At least based on this example, all I can think of the use of an abstract class or pure virtual function is that it is just there so when programmers write a derived class, they know they have to write a function of the same type as the pure virtual function.
@KW-dg6fs
@KW-dg6fs 7 жыл бұрын
virtual void attack()=0; if its pure virtual then enemy1->attack() cannot call it as well. I believe, let me confirm it on my IDE
@katerinadimova6334
@katerinadimova6334 7 жыл бұрын
Bucky you're a legend !
@95shade36
@95shade36 7 жыл бұрын
Thank you for this video, you explained it very well.
@KenFujimoto
@KenFujimoto 12 жыл бұрын
24,000 views! I'm sure it will be 2,400,000,000,000 someday.
@gabirodriguez1000
@gabirodriguez1000 9 жыл бұрын
bruh.. your are absolutely great!
@gaab03
@gaab03 12 жыл бұрын
first i want to say thanks cause your videos are amazing and extremely helpful. Second I have a question about how to access the virtual functions. Do they have to be called using the pointers or can u declare them normally?
@mpk0422
@mpk0422 5 жыл бұрын
This helps me so much... thank god
@Sgoose105
@Sgoose105 5 жыл бұрын
so good better than my professor!
@omahdezavalos
@omahdezavalos 13 жыл бұрын
What editor are You using is kind the cool the highlight theme
@GrozaDanut
@GrozaDanut 11 жыл бұрын
So in Java you have to put abstract before a class to make it abstract. Do you need to put abstract before a class in C++ or that class having only pure virtual functions makes it automatically abstract?
@jerfersonmatos28
@jerfersonmatos28 4 жыл бұрын
Simple and objective.
@honestCeylonReviewers
@honestCeylonReviewers 13 жыл бұрын
Awesome and yeah very use full tutorial .. Thank you very much sir :)
@xamogxusx
@xamogxusx 6 жыл бұрын
thanks, these videos are the best
@lijingyan2009
@lijingyan2009 10 жыл бұрын
love u so much, bucky
@abhijitmit
@abhijitmit 11 жыл бұрын
Bucky has trained more software engineers than all the universities in the world put together.
@benjamindoris5236
@benjamindoris5236 7 жыл бұрын
I have a quick question! If the pure virtual function does nothing, what's the point of making that function in a bass class? You could just do ninja n; n.attack() and monster m; m.attack() or something instead of creating an Enemy object and calls those functions using that, which saves more lines??
@preetigodara544
@preetigodara544 7 жыл бұрын
i think the point is it makes sure that every derived class must have its own attack function , i guess that is needed sometimes
@z-man1938
@z-man1938 7 жыл бұрын
because of what i think is that obviously what the other guy said + pointer makes the programm loading faster . because pointer work from direct memory addressm
@taneix_tutoriales
@taneix_tutoriales 6 жыл бұрын
and what guarantees that the enemy can attack, and not to worry the form that will do it and also the type that he is, if he is a lion, duck, owl, or any one he will only attack in the way that he can and another advantage is to be able to group all the enemies in a list. Then if in your game to stay overnight, list all the enemies and call the sleeping function. and a part of what polymorphism does
@justinek9461
@justinek9461 6 жыл бұрын
@Daniel Gladstone thanks!
@badbytes9644
@badbytes9644 6 жыл бұрын
The purpose is to define an interface for all subclasses to adhere to.
@BasicPoke
@BasicPoke 10 жыл бұрын
Thank you for the video. You are helping me review C++. Note that a pure virtual function can have an implementation, as in the following: class SomeClass { public: virtual void example()=0; //Denotes pure virtual function definition }; void SomeClass::example() { cout
@hendrixansel9750
@hendrixansel9750 6 жыл бұрын
yeah, true. But how is that usefull ?
@martinhdz07sbcglobal
@martinhdz07sbcglobal 12 жыл бұрын
You make life so much easier! Thank you very much.'
@adminos15
@adminos15 12 жыл бұрын
good job Bucky, but why do you use pointers?Are they mandatory?
@areola_ayatollah
@areola_ayatollah 12 жыл бұрын
Yes! This needs to happen
@aylictal
@aylictal 12 жыл бұрын
in follow up, if i declared the different attack functions into the different abstract classes, it wouldn't matter if it's parent class was empty would it? it should still work just fine? what's the point in the pure virtual function? i still don't get it.
@yashaswigowda3535
@yashaswigowda3535 7 жыл бұрын
amazing videos!! Thanks a ton :)
@ragnarw.eliansson5299
@ragnarw.eliansson5299 7 жыл бұрын
Be sure have a the brackets behind enemy lines.
@WowDailyDose
@WowDailyDose 11 жыл бұрын
Hey quick question, this is kinda off topic but in your Main When u created a Ninja n and monster m, why did you have to then create an enemy pointer to refrence them? why couldnt you just do n.attack();
@anamaykane9355
@anamaykane9355 4 жыл бұрын
If a pure virtual function *has* to be overridden, why does it have to be declared in the base class? We could just have functions with the same name in each of the derived classes.
@TheCrapStudio
@TheCrapStudio 11 жыл бұрын
his motto is free education. Read the about section on his website
@degenerategambler000
@degenerategambler000 8 жыл бұрын
forsome reasons it worked in visual studio '15 when we delete 4:44 this part of code ?
@alexanderzhu1415
@alexanderzhu1415 8 жыл бұрын
Yeah, it just didn't print anything.
@degenerategambler000
@degenerategambler000 8 жыл бұрын
microsoft = Anti-developer
@rodrigueskorn
@rodrigueskorn 11 жыл бұрын
May I ask you one question Sir. (a small doubt): Can I have mutiples pure virtual functions in my top class? For example: You made the class Enemy, right, then could it be valid if that enemy could speak, punch, kick, shoot or you know a bunch of stuffs like that? Just a curiosity. class Enemy { virtual void attack () = 0; virtual void speak () = 0; virtual void punch () = 0; virtual void kick () = 0; virtual void eat () = 0; virtual void combo () = 0; virtual void fart () = 0; ... } Thanks!
@ednakazuya12
@ednakazuya12 7 жыл бұрын
In this situation is it recommended to do a separate class?
@austinbritton1029
@austinbritton1029 4 жыл бұрын
Still useful, thanks dude
@Samtuga173
@Samtuga173 9 жыл бұрын
How do i prevent a parent class from being inherited
@MyStuff774
@MyStuff774 12 жыл бұрын
is virtual void attack()=0; neccesary? In java you would just write abstract void attack(); without =0
@eiusamor
@eiusamor 13 жыл бұрын
hahaha, you're hilarious. and these are my favorite c++ tutorials!
@paulaolopes8264
@paulaolopes8264 6 жыл бұрын
is construtor needed all the time in classes?
@blugo561
@blugo561 7 жыл бұрын
What about inheriting nested classes? How can that be done?
@realm087
@realm087 13 жыл бұрын
keep the good work!!!!!!!!
@parison813619
@parison813619 11 жыл бұрын
What if we want to call the base class and than the derive class
@mariahkhayat7833
@mariahkhayat7833 10 жыл бұрын
So helpful, Thank you..
@agnesakne4409
@agnesakne4409 7 жыл бұрын
Why is it not necessary to declare constructors and destructors here?
@sherifmedhat8625
@sherifmedhat8625 2 жыл бұрын
You're the best !
@jambexuk
@jambexuk 7 жыл бұрын
By the way, you can't instantiate an abstract class. Also, there are no virtual constructors. Just tried both, didn't work.
@ruoyigao9826
@ruoyigao9826 7 жыл бұрын
Bucky has a new one except for "Pretty cool hum.", that's "Pretty simply hum." LOL
@sheralikhtk5200
@sheralikhtk5200 5 жыл бұрын
can we somehow use pure virtual functions? if yes then for what?
@ayyoubm
@ayyoubm 4 жыл бұрын
bucky the legend
@rakshithavishalakshiaswath3143
@rakshithavishalakshiaswath3143 7 жыл бұрын
does abstarct classes have ONLY virtual functions??
@RoshanKotian1007
@RoshanKotian1007 9 жыл бұрын
Hey Bucky, Which compiler do you use?
@maxim25o2
@maxim25o2 4 жыл бұрын
Virtual means " If nothing else, then use default one?"
@adammontgomery7980
@adammontgomery7980 5 жыл бұрын
So it's defining an interface where child classes have to implement the pure virtual function?
@Qazqi
@Qazqi 11 жыл бұрын
It is common practice when you need a pure virtual destructor.
@SeekerofYab
@SeekerofYab 11 жыл бұрын
So is this where "I have no greeting" comes from in NPCs?
Buckys C++ Programming Tutorials - 58 - function Templates
8:44
thenewboston
Рет қаралды 399 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 845 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 904 М.
Stack vs Heap Memory in C++
19:31
The Cherno
Рет қаралды 585 М.
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 676 М.
Templates in C++
17:58
The Cherno
Рет қаралды 607 М.
Buckys C++ Programming Tutorials - 64 - Working with Files
8:13
thenewboston
Рет қаралды 405 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 845 М.
Buckys C++ Programming Tutorials - 60 - class Templates
9:58
thenewboston
Рет қаралды 385 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН