I'm trying to store a list of names in alphabetical order, while implementing this linked list, but I've bumped into some errors. This is what I have:

Node.h

class node
{public:
    node(node* , node* , node* , node* , node* , node* , node* , node* , node* , node*);

  private:
    string data;node* previous;node* next;
    friend class list;
    friend class iterator;};

List.h

# include <string>
# include "iterator.h"
# include<iostream>
using std::string;
class list
{public:
    list();void push_back();
    iterator begin();
    iterator end();

    private:
    node* first; node* last;};

And this is where I have my problems (like 'node' no appropriate default constructor, and 'first' undeclared identifier)

# include "node.h"
using std::string;

node::node(node* , node* , node* , node* , node* , node* , node* , node* , node* , node*)
{node* t1 = new node();
        t1->previous = NULL;
        t1->data = "mark";
        t1->next = NULL;
        first = t1;

        node *t2 = new node();
        t2->previous = t1;
        t2->data = "ray";
        t2->next = NULL;
        t1->next = t2;

        node *t3 = new node();
        t3->previous = t2;
        t3->data = "cst";
        t3->next = NULL;
        t2->next = t3;

        node *t4 = new node();
        t4->previous = t3;
        t4->data = "rat";
        t4->next = NULL;
        t3->next = t4;

        node *t5 = new node();
        t5->previous = t4;
        t5->data = "pig";
        t5->next = NULL;
        t4->next = t5;

        node *t6 = new node();
        t6->previous = t5;
        t6->data = "rex";
        t6->next = NULL;
        t5->next = t6;

        node *t7 = new node();
        t7->previous = t6;
        t7->data = "pen";
        t7->next = NULL;
        t6->next = t7;

        node *t8 = new node();
        t8->previous = t7;
        t8->data = "sheep";
        t8->next = NULL;
        t7->next = t8;

        node *t9 = new node();
        t9->previous = t8;
        t9->data = "sun";
        t9->next = NULL;
        t8->next = t9;

        node *t10 = new node();
        t10->previous = t9;
        t10->data = "Dog";
        t10->next = NULL;
        t9->next = t10;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.