template <class ItemType>
void QueType<ItemType>::Enqueue(ItemType newItem)
// Adds newItem to the rear of the queue.
{
NodeType<ItemType>* newNode;
newNode = new NodeType<ItemType>;
newNode->info = newItem;
newNode->next = NULL;
if (qRear == NULL)
qFront = newNode;
else
qRear->next = newNode;
qRear = newNode;
}
I have the class for the queue and it builds fine but i dont know how to add numbers to the queue. in main i have this(these are only code snippets there is way more code in the program):
1 2 3
//Add data to the input end of the queue
void Enqueue(ItemType newItem);
ok thanks but i want to be able to enter loads of numbers into the queue not just 100. so i would put cout << "Enter numbers";
I don't know how to then put those numbers into the queue