I am writing a function that inserts an item into the rear of the queue.

template <class T>
        void Queue<T>::pushBack(const T& item)
        {
        QNode<T>* newNode;
        newNode =  new QNode<T>[item];
        if (empty())
                qFront = newNode;
        else
                qRear->next = newNode;
        qRear = newNode;
        qSize++;
        }

It seems like line five is giving me my error.

I meant method instead of function. Any suggestions?

I've played with it some more and have not been able to locate what it could be still. Any thoughts would be great.

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.