来源:weixliu,2014-09-05 www.cnblogs.com/weixliu/p/3957227.html 如有好的文章投稿,请点击 → 这里查看详情;
#ifndef AH #define AH class B; class A { B *memb; A() { } ~A() { delete memb; } }; #endif
#ifndef BH #define BH class B { }; #endif
#ifndef AH #define AH class B; class A { B b; }; #endif
#ifndef BH #define BH #include "A.h" class B { A a; }; #endif
#ifndef AH #define AH class B; class A { B* b; void setB() { b->haha(); } ~A() { delete b; } }; #endif
#ifndef BH #define BH #include "A.h" class B { A a; void haha() { } }; #endif
#ifndef AH #define AH class B; class A { public: B* b; void setB(); ~A(); }; #endif
#ifndef BH #define BH #include "A.h" class B { public: A a; void haha() { } }; #endif
#include "A.h" #include "B.h" A::~A() { delete b; } void A::setB() { b->haha(); }
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
QQ咨询|关于我们|Archiver|手机版|小黑屋|( 辽ICP备15012455号-4 ) Powered by 期权论坛 X3.2 © 2001-2016 期权工具网&期权论坛 Inc.
下载期权论坛手机APP