y***y 发帖数: 295 | 1 在一个程序中declare class A,又不define class A是干什么用的呢? | t****t 发帖数: 6806 | 2 so that you may use A as incomplete type where applicable -- e.g. A*, A&,
etc
【在 y***y 的大作中提到】 : 在一个程序中declare class A,又不define class A是干什么用的呢?
| c*******h 发帖数: 527 | 3 一般头文件里都这么做呀
类型声明
但不需要函数声明的地方就可以了
【在 y***y 的大作中提到】 : 在一个程序中declare class A,又不define class A是干什么用的呢?
| y***y 发帖数: 295 | 4 that's it?
【在 t****t 的大作中提到】 : so that you may use A as incomplete type where applicable -- e.g. A*, A&, : etc
| x*p 发帖数: 66 | 5 例子:
class A;
class B {
...
class A *pa;
}
class A {
...
class B *pb;
} |
|