Saturday, 28 September 2013

Having trouble with linked list functions

Having trouble with linked list functions

I'm having trouble using a member function of a pointer to a video object.
My code is as follows:
vlist.h:
5 #ifndef VLIST_H
6 #define VLIST_H
7
8 #include<iostream>
9 using namespace std;
10
11 #include<string>
12 #include"video.h"
13
14 class Vlist
15 {
16 public:
17 Vlist();
18 // ~Vlist();
19 void insert(Video *vid);
20 // void insert_alphabetical(Video *vid);
21 void print();
22 // void length();
23 bool lookup(string title);
24 bool remove(string title);
25 private:
26 class Node
27 {
28 public:
29 Node(Video *vid, Node *next)
30 {m_vid = vid; m_next = next;}
31 Video *m_vid;
32 Node *m_next;
33 };
34 Node *m_head;
35 };
36
37

No comments:

Post a Comment