/* main.cpp */
#include <iostream>
#include "1.h"
#include "2.h"
using namespace std;
int main()
{
Choge hoge;
Choge_2 hoge_2;
hoge.set();
cout <<"main.cppでは" <<hoge.ret() <<endl;
hoge_2.display();
return 0;
}
/* 1.h */
#ifndef _1_H_
#define _1_H_
#include <iostream>
#include "2.h"
using namespace std;
class Choge_2{
public:
void display();
};
void Choge_2::display()
{
Choge hoge;
cout <<"1.hでは" <<hoge.ret() <<endl;
}
#endif
/* 2.h */
#ifndef _2_H_
#define _2_H_
class Choge{
private:
int hoge;
public:
void set() { hoge = 5; }
int ret() { return hoge; }
};
#endif