I have a slight problem where to be honest I am totally confused with derived class constructors and need some help.
I have a base class with the parameterised constructor:
Element::Element(RandomNumber &rnd, Console &console)
: rnd(rnd), console(console)
and the derived class constructor of
Jetsam::Jetsam(RandomNumber rnd, Console console):Element(rnd,console)
Basically I want to pass the parameters that are used within the base class constructor into the derived class constructor. I have tried a number of different ways and at the moment I am getting the error message 'no initializer for'.
Does anyone have any help for me or could assist me in understanding my problem. Any help would be much appreciated.
Thank you for your time,
Alyn.
edit :
IntelliSense: "Jetsam::Jetsam(RandomNumber rnd, Console console)" provides no initializer for: e:\c++\my game\my game\jetsam.cpp 7
edit:
Element::Element(RandomNumber &rnd, Console &console)
: rnd(rnd), console(console)
{
}
Jetsam::Jetsam(RandomNumber rnd, Console console):Element(rnd,console)
{
}