I would recommend you use a std::vector instead of a dynamically-allocated array. std::vectors are much easier to work with, and don't leak memory.
However, the missing constructor the error message refers to is Square's constructor. You need to add a constructor for Square that takes no arguments. ONE of the following will do:
class Square {
Square() { ... }
// Square with dimensions of 0 is empty
Square(int length=0, int width=0) { ... }
...
};
Please note that if you put both of these in the file, then you will get an error, because it will be impossible to know which constructor to call when no arguments are given.
You'll probably want the default constructor even if you use a std::vector. "Probably," because you can get around it, if you limit yourself to std::vector's constructors that take an object, eg.:
std::vector<Square> foo(10, Square(0, 0));
// reassign each element accordingly
I've already added this as a comment to the question itself. As Herb Sutter says, std::vector is designed to be interchangeable with arrays:
Why is it so important that vectors be contiguous? Because that’s what you need to guarantee that a vector is layout-compatible with a C array, and therefore we have no reason not to use vector as a superior and type-safe alternative to arrays even when we need to exchange data with C code. So vector is our gateway to other languages and most operating systems features, whose lingua franca is the venerable C array.
The syntax, by the way is (assuming v is a vector) &v[0]. That is, take the address of the first element (and it's a reference, so that works on all std::vectors except for std::vector<bool>) and you'll get a pointer that you can pass to any function that expects a pointer (you can, of course, get the length of the "array" as v.size()).
std::vectorand then use its underlying array ( herbsutter.com/2008/04/07/… ). You then get to avoid worrying about memory leaks.