Here's my function that i call from main.
However i'm getting an error "stackType undeclared"
Does anyone know what i'm doing wrong ?

template<class Type>
void removeX(queueType<Type>& Q)
{     
  stackType<Type> stackQ;
     
   while (!Q.isEmptyQueue())
   {     
     stackQ.push(Q.front());
     Q.deleteQueue();
   }
}
Member Avatar for jencas

The compiler does not know a

template <class Type>
class stackType
{
    ...
};

Maybe you forgot an #include?

Nope i used ... #include <stack> ... in my main program

Member Avatar for jencas

Try 'std::stack' instead of 'stackType'

Thanks jencas !!

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.