Vulkan

关于A中用到B, B中用到A的问题

//A.h
#ifndef AH
#define AH
class B;
class A {
public:
    B* b;
    void setB();
    ~A();
};
#endif


//B.h
#ifndef BH
#define BH
#include "A.h"
class B {
public:
    A a;
    void haha() {
 
    }
};
#endif

//A.cpp
#include "A.h"
#include "B.h"
A::~A() {
    delete b;
}
void A::setB() {
    b->haha();
}


posted on 2015-05-06 23:21  Vulkan  阅读(129)  评论(0编辑  收藏  举报

导航