?? 4_13.cpp
字號:
#include <iostream>
using namespace std;
class Second; //前向引用聲明
class First
{ Second *x;
public:
void callSecond()
{x->funFirst();} //錯誤:在Second類定義之前使用了該類的函數(shù)
};
class Second
{ First *y;
public:
void funFirst()
{cout<<"This is calling Second"<<endl;}
};
int main()
{ First a; a.callSecond(); return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -