I am currently learning OOP for a project I'm working on (I'm in highschool and have some experience with c++; this is my third 'large' (>3 months) c++ project.) I have the basics of C++ classes figured out and managed to make some of the classes for the project.
So these is my page.h header:
class cl_Page{
public:
cl_Page(cl_LessonMoment *parent_param);
cl_Page(cl_SoftRoot *parent_param);
int parent_type;
cl_LessonMoment *parent_lmoment;
cl_SoftRoot *parent_softroot;
char id[256];
//<content>
//Backgrounds.
str_Color bgcolor;
cl_Image bgimage;
//Actual content
vector<cl_Textbox> textboxes;
vector<cl_Button> buttons;
vector<cl_Image> images;
//</content>
};
(include guards and such are not here, but they are in my project)
And this is my page.cpp:
cl_Page::cl_Page(cl_LessonMoment *parent_param){
parent_lmoment = parent_param;
parent_type = 1;
id[0] = '\0';
//bgimage(NULL);
SetColor(bgcolor, 0x000000ff);
}
(the other constructor is similar, it just sets a different type of parent)
My problem is that I want to call the constructor to bgimage (which is of cl_Image class type) inside my cl_Page constructor. If I try this (uncomment the line in the constructor), obviously it won't work.
So yeah, how do I call the constructor now? I really need to construct every member along with the cl_Page object.