⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f0908.cpp

📁 it is a usefull thing
💻 CPP
字号:
//=====================================
// f0908.cpp
// test local object create order
//=====================================
#include<iostream>
using namespace std;
//-------------------------------------
class A{
public:
  A(){ cout<<"A->"; }
};//------------------------------------
class B{
public:
  B(){ cout<<"B->"; }
};//------------------------------------
class C{
public:
  C(){ cout<<"C->"; }
};//------------------------------------
void func(){
  cout<<"\nfunc: ";
  A a;
  static B b;
  C c;
}//--------------------------------------
int main(){
  cout<<"main: ";
  for(int i=1; i<=2; ++i){
    for(int j=1; j<=2; ++j)
      if(i==2) C c; else A a;
    B b;
  }
  func(); func();
}//====================================

 

⌨️ 快捷键说明

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