mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-03-20 03:45:25 +08:00
fix: correct inheritance typo in sizeof example
Fix typo where C1 should inherit from A1 instead of A
This commit is contained in:
@@ -49,7 +49,7 @@ class C {
|
|||||||
class A1 {
|
class A1 {
|
||||||
virtual void fun() {}
|
virtual void fun() {}
|
||||||
};
|
};
|
||||||
class C1 : public A {};
|
class C1 : public A1 {};
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
cout << sizeof(A) << endl; // 8
|
cout << sizeof(A) << endl; // 8
|
||||||
|
|||||||
Reference in New Issue
Block a user