I'm following an example but I keep getting errors the ones I can see are in my linkeList.cpp file. and the more I keep trying to figure it the more errors that keep coming up
//main.cpp
#include "header.h"
#include "linkedList.cpp"
int main()
{
cout << "*************************PROGRAM*********************************";
cout << "\nFind and Delete the node with the smallest info in the list and"
<< "\nFind and Delete all occurrences of a given info from the list .";
unorderedLinkedList<int> myList;
cout << "\n\nInserting random numbers into the list.";
myList.insertFirst(3);
myList.insertFirst(15);
myList.insertFirst(22);
myList.insertLast(1);
myList.insertFirst(31);
myList.insertFirst(48);
myList.insertFirst(57);
myList.insertFirst(87);
myList.insertFirst(67);
cout << "\n\n\tThe elements in the list : ";
myList.print();
cout << "\n\tDeleting all occurrences of the smallest element.";
myList.deleteAllSmall();
cout << "\n\n\tThe elements in the list : ";
myList.print();
cout << "\n\tDeleting first occurrence of the smallest element.";
myList.deleteSmallest();
cout << "\n\n\tThe elements in the list : ";
myList.print();
cout << "\n\n\t";
system("pause");
return 0;
}
//header.h
#include<iostream>
using std::cout;
using std::cin;
#ifndef H_NodeType
#define H_NodeType
template<class Type>
struct nodeType
{
Type info;
nodeType<Type> *link;
};
#endif
template <class Type>
class linkedListIterator
{
public:
linkedListIterator();
linkedListIterator(nodeType<Type> *ptr);
Type operator*();
linkedListIterator<Type> operator++();
booloperator==(const linkedListIterator<Type> &right) const;
booloperator!=(const linkedListIterator<Type> &right) const;
private:
nodeType<Type> *current;
};
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);
}