This commit is contained in:
xliu79
2020-07-19 10:38:38 +08:00
parent 9f6088a31e
commit 2bdeea85d1
129 changed files with 5264 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
/**
* @file moreinhe.cpp
* @brief 普通多继承与虚函数多继承
* @author 光城
* @version v1
* @date 2019-07-21
*/
#include<iostream>
using namespace std;
class A
{
public:
char a;
int b;
};
class B
{
public:
short a;
long b;
};
/**
* @brief 8+16+8=32
*/
class C:A,B
{
char c;
};
int main()
{
cout<<sizeof(A)<<endl; // 8
cout<<sizeof(B)<<endl; // 16
cout<<sizeof(C)<<endl; // 32
return 0;
}