Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Base
- {
- public:
- Base(int i) : _i(i) {}
- void set(int val) { _b = new InBase(val); }
- private:
- int _i;
- class InBase;
- InBase *_b;
- };
- class Base::InBase
- {
- public:
- InBase(int j) : _j(j) {}
- int get() const { return _j; }
- private:
- int _j;
- };
- Errors I get:
- 1>c:\users\alon\documents\visual studio 2010\projects\test2\test2\test.h(8): error C2514: 'Base::InBase' : class has no constructors
- 1> c:\users\alon\documents\visual studio 2010\projects\test2\test2\test.h(13) : see declaration of 'Base::InBase'
Advertisement
Add Comment
Please, Sign In to add comment