Dynamic array of structs

I need to made a dynamic array of structs node, and joy of joys, I'm NOT allowed to use vectors or any STL container. I want to make a vector of linked lists, and I programmed a vector class of my own for a previous assignment. The class worked, but when I adapted the old code to this new assignment, I get this 'error: no matching function for call to ‘MyDS::node::node()'.

Here's the relevant pieces of code.

struct node
{
string data;
node *right;
node *left;
int width, height;

node (string d, node *r=NULL, node *l=NULL, int w=0, int h=0): data(d),
right(r), left(l), width(w), height(h){}
};


constructor
MyDS(int w=10)
{
one=NULL;
last=NULL;
chain=new node[w];
size=0;
width=w;
};

data members
node *chain;
node *one;
node *last;
int size, width;


I think that's all that's necessary... Please help.
You need to write a default constructor for node. The compiler is NOT going to generate one for you in this case because you have written a constructor with parameters.
Looks like it worked! Thanks.
Topic archived. No new replies allowed.