I need to make a pointer to an object of a class. However, it is declared as nullptr first. I need to make it point to that class.
Here, I declare them as nullptr:
#pragma once
#include "Window.h"
#include "Game.h"
#include "Map.h"
#include "Input.h"
class SN {
public:
SN();
Window * window = nullptr;
Game * game = nullptr;
Map * map = nullptr;
Input * input = nullptr;
};
Here I try to assign them to their object:
#include "SN.h"
SN::SN(){
Game * game(this); //I WAS TRYING TO DO THIS BUT IT ALSO DID NOT WORK
Window window(this);
Map map(this);
Input input(this);
}
I pass the object of SN into their constructor, so they can use SN.h too. Please help me, thanks in advance.