I have a class with two different class objects as members. I want to initialize one of the members with another, but so far I can't seem to get this to work.
For example, Game game(&input);
contains an error that there must be a type specified. How might I go about doing this?
class KApp {
private:
Input input;
Game game(&input);
};
class Input {
Input() {};
};
class Game {
private:
Input* input;
public:
Game(Input & inp) : input(&inp) {}
Game(Input* inp) : input(inp) {}
};