I have two header files - MyQueue.h and MyStack.h and I am getting an error that says
1 2
\assignment\assignment\mystack.h(36): error C2953: 'NodeType' : classtemplate has already been defined
\assignment\assignment\myqueue.h(34) : see declaration of 'NodeType'
this is the code it brings me to when i click the error message for the stack
thanks it worked. Maybe you could help with another problem?
I am trying to make a queue and i want to print out the values from the queue
this is what i have in main(this is just calling the function):
1> i:\assignment\assignment\myqueue.h(135) : while compiling classtemplate member function 'void QueType<ItemType>::printQueue(void)'
1> with
1> [
1> ItemType=int
1> ]
1> i:\assignment\assignment\assignment.cpp(10) : see reference to classtemplate instantiation 'QueType<ItemType>' being compiled
1> with
1> [
1> ItemType=int
1> ]
1>i:\assignment\assignment\myqueue.h(137): fatal error C1903: unable to recover from previous error(s); stopping compilation
yes i did that to. The program builds fine if i comment out this q.printQueue(); in main. maybe the problem is here? am i not calling the function right?
Trying to get some information out of the error message. What happens on line 10 in assignment.cpp? line 135 in myqueue.h is that the definition of the printQueue function?
line 10 is QueType<int>q;. this is for making the queue. none of the other functions i made had a problem with this line. line 135 is NodeType <ItemType> * tempPtr = qFront; and line 137 is while (tempPtr != Null)
thats all where all the error messages are bringing me. I'm guessing the code in printQueue is wrong?