f0910.cpp

来自「it is a usefull thing」· C++ 代码 · 共 26 行

CPP
26
字号
//=====================================
// f0910.cpp
// test member object create order
//=====================================
#include<iostream>
using namespace std;
//-------------------------------------
class A{
public:
  A(int x){ cout<<"A:"<<x<<"->"; }
};//-----------------------------------
class B{
public:
  B(int x){ cout<<"B:"<<x<<"->"; }
};//-----------------------------------
class C{
  A a;
  B b;
public:
  C(int x,int y):b(x),a(y){ cout<<"C\n"; }
};//-----------------------------------
int main(){
  C c(15, 9);
}//====================================

 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?