Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // a1.h
- #pragma once
- #include "a2.h"
- namespace a1
- {
- const int x = 10;
- typedef a2::C B;
- }
- // a2.h
- #pragma once
- #include "a1.h"
- namespace a2 {
- class C {
- public:
- int say() {
- return a1::x;
- }
- };
- }
- #include <iostream>
- #include "a1.h"
- #include "a2.h"
- int main()
- {
- a2::C c;
- std::cout << c.say() << std::endl;
- }
- #include "a2.h"
- #include "a1.h"
- // a1.h
- #pragma once
- namespace a2 {
- class C;
- }
- namespace a1
- {
- const int x = 10;
- typedef a2::C B;
- }
Add Comment
Please, Sign In to add comment