Website –
GitHub –
Reddit –
Twitter –
Facebook –
LinkedIn –
Instagram –
Tag: polymorphism c++, tutorial, beginners, game, class, program, pointers, lesson, thenewboston, bucky, roberts, computer, string, vector, download
Xem thêm: https://meohay360.com/category/internet
Nguồn: https://meohay360.com
it's 2021. This ladies and gentlemen is how to make passive income
I am a ninja, ninja chop!
Buckys C++ Programming Tutorials 2011 >>>>>>>>> University Professors 2021 :)))))
I still don't understand that. Is there posible to not using pointers? Do i must use pointer in this example?
https://cplusplus.happycodings.com/data-structures/code18.html
it's basically object typecasting. the ninja object should be equal to or bigger than the enemy object. try Enemy* enemy1 = (class Enemy*)&n; and see if that produces the same result.
ninja… chop
why he used the pointer way to insert the info in the function ??
why he didn't use the normal way
like this
int main() {
ninja n;
monster m;
n.setattackpower(29);
m.setattackpower(99);
n.attack();
m.attack();
};
???
Why do a pointer to Enemy and not just a pointer to Ninja?
I tried the same question with out pointer variable and used dot operator and i am getting some garbage values as attack power can some one please tell me why?????????
Hi Bucky please make a video on encapsulation in c++
Sir Bucky, these are nodoubt The Best! c++ tutorials. Love you 💕
'Never copy paste or you make a mistake' then uses copy paste to fix mistake….
Students praise copy paste
Bucky is a great programming instructor. You can use enemy1 and enemy2 if they were Ninga and monster type respectively. Also you can access the function by pointer (if it was a Ninga type for example) by typing enemy1->attack();
i have been following your tutorials and just wanted to jump right next to polymirphism ffrom thestructures lecture, but i really hoped you had not used pointers to help learners learn polymorphism, passing by address is a bit confusing which couldnt help , you could have used the normal calling of a function and assigning it to an object which you created in the main function . but all in all , these tutorials have really helped me ,
Why use pointer? Is there any advantage of using pointer?
the video ended in such an unexpected way lol
you called n.attack( ) and m.attack( ). This doesn't show that the code knew which attack to call. Cz you're literally telling the code which attack to call. You should've called attack to the e1 like e1->attack( ). That would show the intelligence of the code to know which attack to call. But for that you need to make a virtual attack( ) in enemy.
99 is not something stupid. that's actually the exact damage a monster does.
Thank you sooooo much bro. These examples are exactly what i need! you da best
Why is it printing garbage value for me?…
thank you sir
All ninjas are enemies… we already know that.
facts bucky… facts.
good explaination!
Put on your thinking caps for this one: "Member Enemy::attackPower is inaccessible". attackPower is protected
Why there was pointers in the code? was it really needed?
You should really worry about a monster eating you Bucky!
Nice Tutorial !
Why your mind is full of enemy, weapon,ninja and etc. In the world, there is a love, relation, friend and etc. When we learn from you, we will get same bad things. I hate your mindset
Public enemy
wouldn't 'this->' keyword be helpful if we didn't make enemy object?
Says you should never copy.
Keeps copying throughout the whole tutorial series.
sir i want to you to make video on uml diagram plz