Twitter ►
Instagram ►
Patreon ►
Slack ►
Series Playlist ►
BEST laptop for programming! ►
My FAVOURITE keyboard for programming! ►
FAVOURITE monitors for programming! ►
MAIN Camera ►
MAIN Lens ►
Second Camera ►
Microphone ►
Nguồn: https://chototdayroi.com
Xem thêm bài viết khác: https://chototdayroi.com/cong-nghe/
Xem thêm Bài Viết:
- Bluezone sẽ giúp thu hẹp phạm vi cách ly, giúp xã hội duy trì hoạt động
- Triển khai Bluezone trên diện rộng để truy vết lây nhiễm Covid-19 tại Hải Dương
- Mỹ cấp tốc soạn luật hỗ trợ báo chí đàm phán với Facebook, Google
- Shop online bán vài trăm đơn ngày Tết, shipper kiếm tiền triệu mỗi ngày
- Người dân đã có thể khai báo y tế trực tuyến qua ứng dụng Bluezone
There's no such thing as "minimal impact" in my opinion, there's impact or no impact. I'd rather avoid impact altogether. 😛
Player (const std::String& name) : m_Name (name) { }
why is the :m_Name there?
should it now be the in "{ }"
Also why is no return used?
After watching this I realised how easy is Java 😂.
Let me tell you, I've been going to school for Software Engineering, and I have taken a bunch of different languages. Not a single one of them I really understood, just got it well enough to pass the class. But ever since I've found your CPP series, it's really helped, and I think I finally "get" it. This is the first language where I'm able to code without having to look up the solution 5 minutes into trying. Thank you for this series!
you are genius
Most of the time I've seen a tutorial about virtual functions/vtables it works pretty well to make some diagrams on paper about how it works because it's such an abstract concept that in general people, especially newbies, find a hard time trying to understand what's happening under the hood.
just use a template guys
Excellent explanation. Something I'm looking for. Thank you so much.
How did you learn C plus plus in from where
From where did you learn C plus plus
Please make a video on V Table and Memory allocation. I have been watching C++ playlist, your videos are very good to get concepts more clear.
Türkçe altyazı ekleyenin eline sağlık.
Thanks to the contributor for the Turkish subtitles.
Can anyone explain me
:m_Name(name) {} ?????
it's the second time you save me hours of searching while I'm studying, thanks.
until this video, ur videos is very good. But in this video, there is so much things to uncovered and not explained. hard to cover.
It is interesting that C# shows a warning when not overriding the inherited member, but C++ doesn't.
Oh nooo. Not the ugly and mostly useless these days hungarian notation. Cool vid tho
Thank you!!!
Dude you are great at explaining these things. Probably won't ever see this comment but thank you. I don't write comments a lot but I am teaching myself c++ and I've watched several of your vids and they are awesome and extremely helpful. Thanks again!
Player* p = new Player();
Entity* entity = p;
so now entity is a pointer pointing at p(Player class)
so when calling
entity->GetName();
it should be equal to
p->GetName();
which means the GetName() function inside the Player class is supposed to invoked
am i not correct
why must the virtual keyword be added to make it possible to invoke the GetName() in Player class?
Hey Cherno, could you please make a video on the virtual table and stuff.
Did I miss the video where you explained how to initialise member variables?
Just curious, in another video of yours you state that most of the time you would want to use the stack. Why do you use the new keyword instead of doing something like "Entity e;" ?
Slapping like on all the vids 🙂
Thanks
Congrats, fellow hacker, i recognise you as one of them 'Non-pasters', have a nice journey hooking them VMT-s!
Is there any way in c++ to make a functional that takes some arguments in a class but takes other arguments in inherited class.
For example: I have a class A and a class b inherited from class A. Class a has a function called Print(int a) and class B will have the same function Print with different variables like Print(char* b)
awesome video man
i'm so confused rn
Okay Cherno… we get it… we are dumb. You happy now?
Guess I'll just have to watch more of your videos to understand these unexplained concepts, which I was going to anyways because you're the best teacher ever.
😀
u save me dude thank you so much !!!!!!! <3333
If you are looking for the whole code, here it is:
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct Animal
{
public:
virtual string GetName() { return "Animal"; }
};
struct Dog : public Animal
{
private:
string m_Name;
public:
Dog(const string& name): m_Name(name) {}
string GetName() override { return m_Name; }
};
void PrintName(Animal* animal)
{
cout << animal->GetName() << endl;
}
int main()
{
Animal* a = new Animal();
PrintName(a);
Dog* d = new Dog("dog");
PrintName(d);
cin.get();
return 0;
}
If you're confused by this video and the next video… come back to it after watching more of his videos in the playlist. They are a bit out of order.
Well this video was dog shit wtf is half this shit you typed??
Can you please elaborate on the working of Vtable in the memory if you haven't done already?
This wouldn't have worked if you did:
Entity e;
Player p;
right? I tried it and I had to use a pointer to each on the heap.
So let me get this right… virtual functions are basically a way to allow a derived class to override a method from its base class so that everything stays nice and organized? So you can declare a function as virtual so that base classes won't use that function when calling an instance of their own function?
Did he delete some videos? seems like a giant leap, but maybe i'm just stupid.
You a life saver. keep up the good work!
Your videos are amazing tools for learning this stuff.