struct Rect {
int x,y;
int w,h;
Rect(int x,int y,int w,int h) {
this->x=x;
this->y=y;
this->w=w;
this->h=h;
}
};
But I have serious problems when I try to create a struct that contains a Rect variable:
1 2 3
struct Sprite {
Rect rect;
};
I receive an error message because there isn't a empty constructor in Rect class. What you suggests? I have to use obligatorily dynamic memory? For example:
????? There is a way to do that without using dynamic memory? I think that dynamic memory is superfluous in this specific situation. Or not?
Thanks in advance