update dir

This commit is contained in:
light-city
2019-07-21 11:41:27 +08:00
parent 75dcf11c89
commit 9d90e047fd
32 changed files with 1389 additions and 0 deletions

43
sizeof/moreinhe.cpp Normal file
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;
}