📄 hybmain.cpp
字号:
// HybMain.cpp
#include "HybClass.h"
main()
{
cout << "sizeof(Component)/sizeof(int): " <<
sizeof(Component)/sizeof(int) << endl;
cout << "sizeof(Base)/sizeof(int) : " <<
sizeof(Base)/sizeof(int) << endl;
cout << "sizeof(Hybrid)/sizeof(int) : " <<
sizeof(Hybrid)/sizeof(int) << endl;
cout << "执行 “Hybrid x” 之后: " << endl;
Hybrid x;
cout << "x.Get() : " << x.Get() << endl;
cout << "x.GetBase(): " << x.GetBase() << endl;
cout << "x.GetC1() : " << x.GetC1() << endl;
cout << "x.GetC2() : " << x.GetC2() << endl;
cout << "执行 “x.Double()” 之后: " << endl;
x.Double();
cout << "x.Get() : " << x.Get() << endl;
cout << "x.GetBase(): " << x.GetBase() << endl;
cout << "x.GetC1() : " << x.GetC1() << endl;
cout << "x.GetC2() : " << x.GetC2() << endl;
cout << "执行 “x.DoubleBase()”之后: " << endl;
x.DoubleBase();
cout << "x.Get() : " << x.Get() << endl;
cout << "x.GetBase(): " << x.GetBase() << endl;
cout << "x.GetC1() : " << x.GetC1() << endl;
cout << "x.GetC2() : " << x.GetC2() << endl;
cout << "执行 “x.DoubleComp()”之后: " << endl;
x.DoubleComp();
cout << "x.Get() : " << x.Get() << endl;
cout << "x.GetBase(): " << x.GetBase() << endl;
cout << "x.GetC1() : " << x.GetC1() << endl;
cout << "x.GetC2() : " << x.GetC2() << endl;
cout << "执行 “Hybrid y(7,8,9,10)”之后: " << endl;
Hybrid y(7,8,9,10);
cout << "y.Get() : " << y.Get() << endl;
cout << "y.GetBase(): " << y.GetBase() << endl;
cout << "y.GetC1() : " << y.GetC1() << endl;
cout << "y.GetC2() : " << y.GetC2() << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -