So many errors!!!:(

trying to teach myself and just cant get rid of these errors. any help would be greatly apprecaited.
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include "videoType.h"
#include "videoListType.h"

using namespace std;

void createVideoList(ifstream& infile, videoListType& videoList);

void displayMenu();

int main()
{
    videoListType videoList;
    int choicel
    char ch;
    string title;
    
    ifstream infile;
    
    infile.open("videoDat.txt");
    if (!infile)
    {
       cout << "The input file does not exist. "
            << "The program terminates!!!" << endl;
       return 1;
    }
    
    createVideoList(infile, videoList);
    infile.close();
    
    displayMenu();
    cout << "Enter your choice: ";
    cin >> choice;
    cin.get(ch);
    cout << endl;
    
    while (choice != 9)
    {
          switch (choice)
          {
          case 1:
               cout << "Enter the title: ";
               getline(cin, title);
               cout << endl;
               
               if (videoList.videoSearch(title))
                  cout << "The store carries " << title
                      << endl;
               else
                  cout << "The store does not carry "
                       << title << endl;
               break;
               
          case 2:
               cout << "Enter the title: ";
               getline(cin, title);
               cout << endl;
               
               if (videoList.videoSearch(title))
               {
                   if (videoList.isVideoAvailable(title))
                   {
                       videoList.videoCheckOut(title);
                       cout << "Enjoy your movie: "
                            << title << endl;
                   }
                   else
                       cout << "Currently " << title
                            << " is out of stock." << endl;
               }
               else
                   cout << "The store does not carry "
                        << title << endl;
               break;
               
           case 3:
                cout << "Enter the title: ";
                getline(cin, title);
                cout << endl;
                
                if (videoList.videoSearch(title))
                {
                    videoList.videoCheckIn(title)
                    cout << "Thanks for returning " << title << endl;
                }
                else
                    cout << "The store does not carry "
                         << title << endl;
                break;
              
            case 4:
                 cout << "Enter the title: ";
                 getline(cin, title);
                 cout << endl;
                 
                 if (videoList.videoSearch(title))
                 {
                    cout << title << " is currently in "
                         << "stock." << endl;
                 else
                    cout << title << " is currently out "
                         << "of stock." << endl;
                 }
                 else
                    cout << "The store does not carry "
                         << title << endl;
                 break;
                 
             case 5:
                  videoList.videoPrintTitle();
                  break;
                  
             case 6:
                  videoList.print();
                  break;
                  
             default:
                  cout << "Invalid selection." << endl;
             }
             
             displayMenu();
             
             cout << "Enter your choice: ";
             cin >> choice;
             cin.get(ch);
             cout << endl;
    }
    
    return 0;
}

void createVideoList(ifstream& infile, videoListType& videoList)
{
     string title;
     string star1;
     string star2;
     string producer;
     string director;
     string productionCo;
     
     char ch;
     int inStock;
     
     videoType newVideo;
     
     getline(infile, title);
     
     while (infile)
     {
           getline(infile, star1);
           getline(infile, star2);
           getline(infile, producer);
           getline(infile, director);
           getline(infile, productionCo);
           infile >> inStock;
           infile.get(ch);
           newvideo.setVideoInfo(title, star1, star2, producer, director,
                                 productionCo, inStock);
           videoList.insertFirst(newVideo);
           
           getline(infile, title);
     }
}

void displayMenu()
{
     cout << "Select one of the following:" << endl;
     cout << "1: To check wether the store carries a "
          << "particular video." << endl;
     cout << "2: To check out a video." << endl;
     cout << "3: To check in a video." << endl;
     cout << "4: To ceheck wether a perticular video is "
          << "in stock." << endl;
     cout << "5: To print only the titles of all the videos."
          << endl;         
     cout << "6: To print a list of all the videos." << endl;
     cout << "9: To exit" << endl;
}

    
    system("PAUSE");
    return EXIT_SUCCESS;
}

videoType.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef H_videoType
#define H_videoType

#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>

using namespace std;

class videoType
{
      friend ostream& operator<< (ostream&, const videoType&);
      
public:
       void setViddeoInfo(string title, string star1,
                          string star2, string producer,
                          string director, string productionCo,
                          int setInStock);
       
       int getNoOfCopiesInStock() const;
       
       void checkOut();
       
       void checkIn();
       
       void printTitle() const;
       
       void printInfo() const;
       
       bool checkTitle(string title);
       
       void updateInStock(int num);
       
       void setCopiesInStock(int num);
       
       string getTitle() const;
       
       videoType(string title = "", string star1 = "",
                 string star2 = "", string producer = "",
                 string director = "", string productionCo = "",
                 int setInClock = 0);
                 
       bool operator==(const videoType&) const;
       bool operator!=(const videoType&) const;
       
private:
        string videoTitle;
        
        string movieStar1;
        
        string movieStar2;
        
        string movieProducer;
        
        string movieProductionCo;
        
        int copiesInStock;
        
};

#endif 

videoType.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "videoType.h"

using namespace std;

void videoType::setVideoInfo(string title, string star1,
                          string star2, string producer,
                          string director, string productionCo,
                          int setInStock)
{
    videoTitle = title;
    movieStar1 = star1;
    movieStar2 = star2;
    movieDirector = director;
    movieProductionCo = productionCo;
    copiesInStock = setInClock;
}

void videoType::checkOut()
{
     if (getNoOfCopies() > 0)
         copiesInStock__;
         
     else
         cout << "Currently out of Stock" << endl;
}

void videoType::checkIn()
{
     copiesInStock++;
}

int videoType::getNoOfCopiesInStock() const
{
    return copiesInStock;
}

void videoType::printTitle() const
{
     cout << "Video Title: " << videoTitle << endl;
}

void videoType::printInfo() const
{
     cout << "Video Title: " << videoTitle << endl;
     cout << "Stars: " << movieStar1 << " and "
          << movieStar2 << endl;
     cout << "Producer: " << movieProducer << endl;
     cout << "Director: " << movieDirector << endl;
     cout << "Production Company: " << movieProductionCo
          << endl;
     cout << "Copies in stock: " << copiesInStock
          << endl;
}

bool videoType::checkTitle(stringf title)
{
     return(videoTitle == title);
}

void videoType::updateInStock(int num)
{
     copiesInStock += num;
}

void videoType::setCopiesInStock(int num)
{
     copiesInStock = num;
}

string videoType::getTitle() const
{
       return videoTitle;
}

videoType::videoType(string title, string star1,
                     string star2, string producer,
                     string director, string productionCo,
                     int setInStock)
{
     setVideoInfo(title, star1, star2, producer, director,
                  productionCo, setInStock);
}

bool videoType::operator==(const videoType& other) const
{
     return (videoTitle == other.videoTitle);
}

bool videoType::operator!=(CONST VideoType& other) const
{
     return (videoTitle != other.videoTitle);
}

ostream& operator<< (ostream& osObject, const videoType& video)
{
         osObject << endl;
         osObject << "Video Title: " << video.videoTitle << endl;
         osObject << "stars: " << video.movieStar1 << " and "
                  << video.movieStar2 << endl;
         osObject << "Producer: " << video.movieProducer << endl;
         osObject << "Director: " << video.movieDirector << endl;
         osObject << "Production Company: " << video.movieProductionCo
                  << endl;
         osObject << "Copies in stock: " << video.copiesInStock << endl;
         osObject << "____________________________________" << endl;
         
         return osObject;
}

unorderedLinkedList.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef H_unorderedLinkedList
#define H_unorderedLinkedList

#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>


using namespace std;

template <class Type>
class unorderedLinkedList: public linkedListType<Type>
{
public:
      bool search(const Type& searchItem) const;
      
      void insertFirst(const Type& newItem);
      
      void insertLast(const Type& newItem);
      
      void deleteNode(const Type& deleteItem);
};

#endif 


unorderedLinkList.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "unorderedLinkedList.h"

using namespace std;

template <class Type>
bool unorderedLinkedList<Type>::
                   search(const Type& searchItem) const
{
    nodeType<Type> *current;
    bool found = false;
    current = first;
    
    while (current != NULL && !found)
         if (current->info == searchitem)
             found = true;
         else
            current = current->link;
            
         return found;
}

template <class Type>
void unorderedLinkedList<Type>::insertFirst(const Type& newItem)
{
     nodeType<Type> *newNode;
     newNode = new nodeType<Type>;
     newNode->info = newItem;
     newNode->link = first;
     first = newNode;
     
     count++;
     
     if (last == NULL)
     
         last = newNode;
}

template <class Type>
void unorderedLinkedList<Type>::insertLast(const Type& newItem)
{
     nodeType<Type> *newNode;
     
     newNode = new nodeType<Type>;
     newNode->info = newItem;
     newNode->link = NULL;
     
     if (first == NULL)
     
     {
         first = newNode;
         last = newNode;
         count++;
     }
     else
     {
         last->link = newNode;
         last = newNode;
         
         count++;
         
     }
}

template <class Type>
void unorderedLinkedList<Type>::deleteNode(const Type& deleteItem)
{
     nodeType<Type> *current;
     nodeType<Type> *trailCurrent;
     bool found;
     
     if (first == NULL)
        cout << "Cannot delete from an empty list."
             << endl;
     else
     {
         if (first->info == deleteItem)
         {
            current = first;
            first = first->link;
            count__;
            
            if (first == NULL)
                last = NULL;
            
            delete current;
         }
         else
         {
             found = false;
             trailCurrent = first;
             
             current = first->link;
             
             while (current != NULL && !found)
             {
                   if (current->info != deleteItem)
                   {
                      trailCurrent = current;
                      current = current-> link;
                   }
                   else
                       found = true;
             }
             if (found)
             {
                trailCurrent->link = current->link;
                count--;
                
                if (last == current)
                
                    last = trailCurrent;
                    
                delete current;
             }
             else
                cout << "The item to be deleted is not in "
                     << "the list." << endl;
         }
     }
}
            

videoListType.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef H_videoListType
#define H_videoListType

#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "unorderedLinkedList.h"
#include "videoType.h"

using namespace std;

class videoListType:public unorderedLinkedList<videoType>
{
public:
       bool videoSearch(string title) const;
       
       bool isVideoAvailable(string title) const;
       
       void videoCheckOut(string title);
       
       void videoCheckIn(string title);
       
       bool videoCheckTitle(string title) const;
       
       void videoUpdateInStock(string title, int num);
       
       void videoSetCopiesInStock(string title, int num);
       
       void videoPrintTitle() const;
       
private:
        void searchVideoList(string title, bool& found,
                             nodeType<videoType>* &current) const;

};
#endif 


videoListType.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "videoType.h"
#include "unorderedLinkedList.h"

void videoListType::searchVideoList(string title, bool& found,
                                    nodeType<videoType>* &current) const
{
                                    found = false;
                                    
                                    current = first;
                                    
                                    while (current != NULL && !found)
                                        if (current->info.checkTitle(title))
                                            found = true;
                                        else
                                            current = current->link;
}

bool videoListType::isVideoAvailable(string title) const
{
     bool found;
     nodeType<videoType> *location;
     
     searchVideoList(title, found, location);
     
     if (found)
         found = (location->info.getNoOfCopiesInStock() > 0);
     else
         found = false;
         
     return found;
}

void videoListType::videoCheckIn(string title)
{
     bool found = false;
     nodeType<videoType> *location;
     
     searchVideolist(title, found, location);
     
     if (found)
         location->info.checkOut();
     else
         cout << "The store does not carry " << title
              << endl;
}

bool videoListType::videoCheckTitle(string title)
{
     bool found = false'
     nodeType<videoType> *location;
     
     
     searchVideoList(title, found, location);
     
     return found;
}

void videoListType::videoUpdateInStock(string title, int num)
{
     bool found = false;
     nodeType<videoType> *location;
     
     searchVideolist(title, found, location);
     
     if (found)
         location->info.updateInStock(num);
     else
         cout << "The store does not carry " << title
              << endl;
}

void videoListType::videoSetCopiesInStock(string title, int num)
{
     bool found = false;
     nodeType<videoType> *location;
     
     searchVideolist(title, found, location);
     
     if (found)
         location->info,.setCopiesInStock(num);
         
         return found;
}

void videoListType::videoPrintTitle() const
{
     nodeType<videoType>* current;
     
     current = first;
     while (current != NULL)
     {
           current->info.printTitle();
           current = current->link;
     }
}

            

and the error codes I just cant get rid of:
In file included from videoListType.h:8,
from main.cpp:6:
unorderedLinkedList.h:13: error: expected template-name before '<' token
unorderedLinkedList.h:13: error: expected `{' before '<' token
unorderedLinkedList.h:13: error: expected unqualified-id before '<' token
unorderedLinkedList.h:13: error: expected `;' before '<' token

In file included from main.cpp:6:
videoListType.h:14: error: invalid use of undefined type `class unorderedLinkedList<videoType>'
unorderedLinkedList.h:13: error: declaration of `class unorderedLinkedList<videoType>'
videoListType.h:34: error: `nodeType' has not been declared
videoListType.h:34: error: expected `,' or `...' before '<' token
videoListType.h:34: error: ISO C++ forbids declaration of `parameter' with no type

main.cpp: In function `int main()':
main.cpp:17: error: expected primary-expression before "int"
main.cpp:17: error: expected `;' before "int"
main.cpp:36: error: `choice' undeclared (first use this function)
main.cpp:36: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:37: error: `ch' undeclared (first use this function)

main.cpp:87: error: expected `;' before "cout"

main.cpp:103: error: expected primary-expression before "else"

main.cpp:103: error: expected `;' before "else"
main.cpp:117: error: 'class videoListType' has no member named 'print'

main.cpp: In function `void createVideoList(std::ifstream&, videoListType&)':
main.cpp:160: error: `newvideo' undeclared (first use this function)
main.cpp:162: error: 'class videoListType' has no member named 'insertFirst'

main.cpp: At global scope:
main.cpp:184: error: expected constructor, destructor, or type conversion before '(' token
main.cpp:184: error: expected `,' or `;' before '(' token
main.cpp:185: error: expected unqualified-id before "return"
main.cpp:185: error: expected `,' or `;' before "return"
main.cpp:186: error: expected declaration before '}' token

make.exe: *** [main.o] Error 1

Execution terminated
What is nodeType? I can't see it being defined anywhere.

On line 53 in videoListType.cpp you have used a ' instead of ;.
that whole first section:

from main.cpp:6:
unorderedLinkedList.h:13: error: expected template-name before '<' token
unorderedLinkedList.h:13: error: expected `{' before '<' token
unorderedLinkedList.h:13: error: expected unqualified-id before '<' token
unorderedLinkedList.h:13: error: expected `;' before '<' token

means that in unorderedlinkedlist.h on line 13 you can't use the <
unorderedLinkedList.h:13: error: expected template-name before '<' token

unorderedLinkedList uses linkedListType without declaring it. You need to pull in the include file.
thxs peter87 for the syntax error. see what I think my main problem is I'm trying to add unorderedLinkedList to the program. Do I need it? The book calls for it but it links into the whole chapter of the book so I can't believe its that complex of a program for this chapter.
Last edited on
linkedListType.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef H_linkedListType
#define H_linkedListType

#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "linkedListIterator.h"


using namespace std;

template <class Type>
class linkedListType
{
public:
       const linkedListType<Type>& operator=(const linkedListType<Type>&);
       
       void initializeList();
       
       bool isEmptyList();
       
       void print() const;
       
       int length() const;
       
       void destroyList();
       
       Type front() const;
       
       Type back() const;
       
       virtual bool search(const Type& searchItem) const = 0;
       
       virtual void insertFirst(const Type& newItem) = 0;
       
       virtual void insertLast(const Type& newItem) = 0;
       
       virtual void deleteNode(const Type& deleteItem) = 0;
       
       linkedListIterator<Type> begin();
       
       linkedListIterator<Type> end();
       
       linkedListType();
       
       linkedListType(const linkedListType<Type>& otherList);
       
       ~linkedListType();
       
protected:
          int count;
          nodeType<Type> *first;
          nodeType<Type> *last;

private:
        void copyList(const linkedListType<Type>& OtherList);
        
};

                 
#endif 

linkedListType.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "linkedListIterator.h"
#include "linkedListType.h"

using namespace std;

template <class Type>
bool linkedListType<Type>::isEmptyList() const
{
     return (first == NULL);
}

template <class Type>
linkedListType<Type>::linkedListType()
{
     first = NULL;
     last = NULL;
     count = NULL;
}

template <class Type>
void linkedListType<Type>::destroyList(0
{
     nodeType<Type> *temp;
     
     while (first != NULL)
     {
           temp = first;
           first = first->link;
           delete tmep;
     }
     
     last = NULL;
     
     count = 0;
}

template <class Type>
void linkedListType<Type>::initializeList()
{
     destroyList();
}

template <class Type>
void linkedListType<Type>::print() const
{
     nodeType<Type> *current;
     
     current = first;
     
     while (current != NUL)
     {
           cout << current->info<< " ";
           current = current->link;
     }
}

template <class Type>
int linkedListType<Type>::length() const
{
    return count;
}

template <class Type>
Type linkedListType<Type>::front() const
{
     assert(first != NUL);
     
     return first->info;
}

template <class Type>
Type linkedListType<Type>::back() const
{
     assert(last != NULL);
     
     return last->info;
}

template <class Type>
linkedListIterator<Type> linkedListType<Type>::begin()
{
    linkedListIterator<Type> temp(first);
    
    retun temp;
}

template <class Type>
linkedListIterator<Type> linkedListType<Type>::end()
{
    linkedListIterator<Type> temp(NULL);
    
    return temp;
}

template <class Type>
void linkedListType<Type>::copyList(const linkedListType<Type>& otherList)
{
    nodeType<Type> *newNode;
    nodeType<Type> *current;
    
    if (first != NULL)
        destroyList();
        
    if (otherList.first == NULL)
    {
        first = NULL;
        last = NULL;
        count = 0;
    }
    else
    {
        current = otherList.first;
        
        count = otherList.count;
        
        first = new nodeType<Type>;
        first->info = current->info;
        first->link = NULL;
        
        last = first;
        
        current = current->link;
        
        while (current != NULL)
        {
              newNode = new nodeType<Type>;
              newNode->info = current->info;
              newNode->link = NULL;
              
              last->link = newNode;
              last = newNode;
              
              current = current->link;
              
        }
   }
}

template <class Type>
linkedListType<Type>::~linkedListType()
{
        destroyList();
}

template <class Type>
bool linkedListType<Type>::linkedListType
                           (const linkedListType<Type>& otherList)
{
     first = NULL;
     copyList(otherList);
}

template <class Type>
const linkedListtype<Type>& linkedListType<Type>::operator=
                           (const linkedListType<Type>& otherList)
{
     if (this != &otherList)
     {
              copyList(otherlist);
     }
     
     return *this;
}

linkedListIterator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef H_linkedListIterator
#define H_linkedListIterator

#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>

using namespace std;

template <class Type>
class linkedListIterator
{
public:
       linkedListIterator();
       
       linkedListIterator(nodeType<Type> *ptr);
       
       Type operator*();
       
       linkedListIterator<Type> operator++();
       
       bool operator==(const linkedListIterator<Type>& right) const;
       
       bool operator!=(const linkedListIterator<Type>& right) const;
       
private:
        nodeType<Type> *current;
};



#endif 

linkedListIterator.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>

using namespace std;

template <class Type>
linkedListIterator<Type>::linkedListIterator()
{
    current = NULL;
}

template <class Type>
linkedListIterator<Type>::linkedListIterator(nodeType<Type> *ptr)
{
    current = ptr;
}

template <class Type>
Type linkedListIterator<Type>::operator*()
{
     return current->info;
}

template <class Type>
linkedListIterator<Type> linkedListIterator<Type>::operator++()
{
    current = current->link;
    return *this;
}

template <class Type>
bool linkedListIterator<Type>::operator==
                          (const linkedListIterator<Type>& right) const
{
     return (current == right.current);
}

template <class Type>
bool linkedListIterator<Type>::operator!=
                           (const linkedListIterator<Type>& right) const
{
     return (current != right.current);
}
Last edited on
and my errors for last post:

In file included from linkedListType.h:8,
from unorderedLinkedList.h:8,
from videoListType.h:8,
from main.cpp:6:
linkedListIterator.h:17: error: expected `)' before '<' token

linkedListIterator.h:28: error: ISO C++ forbids declaration of `nodeType' with no type
linkedListIterator.h:28: error: expected `;' before '<' token
In file included from unorderedLinkedList.h:8,
from videoListType.h:8,
from main.cpp:6:
linkedListType.h:29: error: `type' does not name a type
linkedListType.h:53: error: ISO C++ forbids declaration of `nodeType' with no type
linkedListType.h:53: error: expected `;' before '<' token
linkedListType.h:54: error: ISO C++ forbids declaration of `nodeType' with no type

linkedListType.h:54: error: expected `;' before '<' token
In file included from main.cpp:6:
videoListType.h:34: error: `nodeType' has not been declared
videoListType.h:34: error: expected `,' or `...' before '<' token
videoListType.h:34: error: ISO C++ forbids declaration of `parameter' with no type

main.cpp: In function `int main()':
main.cpp:17: error: expected primary-expression before "int"
main.cpp:17: error: expected `;' before "int"

main.cpp:36: error: `choice' undeclared (first use this function)
main.cpp:36: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:37: error: `ch' undeclared (first use this function)

main.cpp:87: error: expected `;' before "cout"

main.cpp:103: error: expected primary-expression before "else"

main.cpp:103: error: expected `;' before "else"

main.cpp: In function `void createVideoList(std::ifstream&, videoListType&)':
main.cpp:160: error: `newvideo' undeclared (first use this function)

main.cpp: At global scope:
main.cpp:184: error: expected constructor, destructor, or type conversion before '(' token
main.cpp:184: error: expected `,' or `;' before '(' token
main.cpp:185: error: expected unqualified-id before "return"
main.cpp:185: error: expected `,' or `;' before "return"
main.cpp:186: error: expected declaration before '}' token

make.exe: *** [main.o] Error 1

Execution terminated
In your linkedListIterator.h:17, is 'nodeType' template class?
If it's not, try to change 'nodeType<Type>' to Type.

Line 25 in linkedListType.cpp you use 0 instead of ).

And you still use nodeType without there being such a type.
Last edited on
I agree with the nodeType problem. I don't see anywhere in the book that declares it. will fix error in linkedListType.cpp and linkedListIterator.h
Last edited on
I believe this is suppose to be in it. Just have no idea where to but it.
1
2
3
4
5
6
template <class Type>
struct nodeType
{
    Type info;
   nodeType<Type> *link;
}
Topic archived. No new replies allowed.