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,29 @@
/**
* @file genA.cpp
* @brief 普通成员函数大小为1,一个类中,虚函数本身、成员函数(包括静态与非静态)和静态数据成员都是不占用类对象的存储空间。
* @author 光城
* @version v1
* @date 2019-07-21
*/
#include<iostream>
using namespace std;
class A
{
public:
A();
~A();
static int a;
static void fun3();
void fun();
void fun1();
};
int main()
{
cout<<sizeof(A)<<endl; // 1
return 0;
}