I have a struct with a constructor likes:
struct Rectangle
{
int width;
int height;
Rectangle(int _width, int _height)
{
width = _width;
height = _height;
}
}
And I create a Rectangle that is okay: Rectangle rect = Rectangle(4, 8);
But how to create a list a Rectangle struct with constructor: Rectangle rects[10];
That is an error: no default constructor exists for class "Rectangle".
Does it not allow create a list if I define a constructor in struct?
And how do I fix it?
Thanks!