mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-11 06:27:22 +08:00
support bazel complie this project and format code.
This commit is contained in:
@@ -6,38 +6,33 @@
|
||||
* @date 2019-07-21
|
||||
*/
|
||||
|
||||
#include<iostream>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class A
|
||||
{
|
||||
public:
|
||||
char a;
|
||||
int b;
|
||||
class A {
|
||||
public:
|
||||
char a;
|
||||
int b;
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
public:
|
||||
short a;
|
||||
long b;
|
||||
class B {
|
||||
public:
|
||||
short a;
|
||||
long b;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 8+16+8=32
|
||||
*/
|
||||
class C:A,B
|
||||
{
|
||||
char c;
|
||||
class C : A, B {
|
||||
char c;
|
||||
};
|
||||
|
||||
int main() {
|
||||
cout << sizeof(A) << endl; // 8
|
||||
cout << sizeof(B) << endl; // 16
|
||||
cout << sizeof(C) << endl; // 32
|
||||
|
||||
int main()
|
||||
{
|
||||
cout<<sizeof(A)<<endl; // 8
|
||||
cout<<sizeof(B)<<endl; // 16
|
||||
cout<<sizeof(C)<<endl; // 32
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user