Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Circular Dependencies / Incomplete Types
- #include "Spritesheet.h";
- class Stuffcollection {
- public:
- void myfunc (Spritesheet *spritesheet);
- void myfuncTwo ();
- };
- void Stuffcollection::myfunc(Spritesheet *spritesheet) {
- unsigned int myvar = 5 * spritesheet->spritevar;
- }
- void myfunc2() {
- //
- }
- #include "Stuffcollection.h"
- class Spritesheet {
- public:
- void init();
- };
- void Spritesheet::init() {
- Stuffcollection stuffme;
- myvar = stuffme.myfuncTwo();
- }
- #ifndef STUFFCOLLECTION_H_GUARD
- #define STUFFCOLLECTION_H_GUARD
- class Spritesheet;
- class Stuffcollection {
- public:
- void myfunc (Spritesheet *spritesheet);
- void myfuncTwo ();
- };
- #endif
- #include "Stuffcollection.h"
- #include "Spritesheet.h"
- void Stuffcollection::myfunc(Spritesheet *spritesheet) {
- unsigned int myvar = 5 * spritesheet->spritevar;
- }
- void Stuffcollection::myfuncTwo() {
- //
- }
- #ifndef SPRITESHEET_H_GUARD
- #define SPRITESHEET_H_GUARD
- class Spritesheet {
- public:
- void init();
- };
- #endif
- #include "Stuffcollection.h"
- #include "Spritesheet.h"
- void Spritesheet::init() {
- Stuffcollection stuffme;
- myvar = stuffme.myfuncTwo();
- }
Add Comment
Please, Sign In to add comment