support bazel complie this project and format code.

This commit is contained in:
zhangxing
2023-03-30 00:15:11 +08:00
committed by light-city
parent 1f86192576
commit 3c8a3f259b
641 changed files with 10349 additions and 9523 deletions

View File

@@ -1,33 +1,30 @@
/**
* @file static.cpp
* @brief 静态数据成员
* 静态数据成员被编译器放在程序的一个global data members中它是类的一个数据成员但不影响类的大小。不管这个类产生了多少个实例还是派生了多少新的类静态数据成员只有一个实例。静态数据成员一旦被声明就已经存在。
* 静态数据成员被编译器放在程序的一个global data
* members中它是类的一个数据成员但不影响类的大小。不管这个类产生了多少个实例还是派生了多少新的类静态数据成员只有一个实例。静态数据成员一旦被声明就已经存在。
* @author 光城
* @version v1
* @date 2019-07-21
*/
#include<iostream>
#include <iostream>
using namespace std;
class A
{
public:
char b;
virtual void fun() {};
static int c;
static int d;
static int f;
class A {
public:
char b;
virtual void fun(){};
static int c;
static int d;
static int f;
};
int main() {
/**
* @brief 16 字节对齐、静态变量不影响类的大小、vptr指针=8
*/
cout << sizeof(A) << endl;
int main()
{
/**
* @brief 16 字节对齐、静态变量不影响类的大小、vptr指针=8
*/
cout<<sizeof(A)<<endl;
return 0;
return 0;
}