Skip to content

Conversation

ericzeng95
Copy link

sizeof 章节 关于具有虚函数的类的继承的示范代码有误.

class A1 {
virtual void fun() {}
};
class C1 : public A {};

class A {
public:
char a;
int b;
};

此处的 A 不是具有虚函数的类,C1 正确是示范应是继承 A1

@FlyDragonMan
Copy link

FlyDragonMan commented May 25, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants