#pragma once
class CA
{
public:
CA(void);
CA(int age);
~CA(void);
public:
void Display();
private:
int m_nAge;
};
#include "A.h"
#include <iostream>
using namespace std;
CA::CA(void)
{
}
CA::CA(int age)
{
this->m_nAge = age;
}
CA::~CA(void)
{
}
void CA::Display()
{
cout << "年龄:" << m_nAge << endl;
}
#pragma once
#include "A.h"
class CB
{
public:
CB(void);
CB(CA *pCA);
~CB(void);
void Run();
private:
CA *m_aObj;
};
#include "B.h"
#include <iostream>
#include <stdio.h>
using namespace std;
CB::CB(void)
{
this->m_aObj = NULL;
}
CB::CB( CA *pCA )
{
this->m_aObj = pCA;
}
CB::~CB(void)
{
}
void CB::Run()
{
if (this->m_aObj != NULL)
{
this->m_aObj->Display();
}
}
#include <list>
#include <Windows.h>
#include <iostream>
#include <boost/timer.hpp>
#include "A.h"
#include "B.h"
using namespace boost;
using namespace std;
void Get()
{
}
int main()
{
Get();
CA a(25);
CB b(&a);
b.Run();
/*b(&a);
b.Run();*/
int wait;
cin >> wait;
return 0;
}