error cannot convert 'Customer' to 'NodeType<Customer>*' in assignment:
Here is the display function from queue.cpp
template<class C>
void Queue<C>::display(ostream& disp) const
{
NodeType<C>* location = front; // Sets location to first item in queue
while(location != NULL)
{
location = location->info;
disp << location << endl;
location = location->next;
}
Here is driver.cpp
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include "Customer.h"
#include "Queue.h"
using namespace std;
int main()
{
Customer c;
Queue<Customer> line;
int simLngth;
int avgTrans;
int numServers;
int avgArvl;
char answer;
int count = 1;
// Get simulation parameters
cout << "Please enter values for the following parameters: " << endl;
cout << "Simulation length: ";
cin >> simLngth;
cout << "Average transaction time: ";
cin >> avgTrans;
cout << "Number of servers: ";
cin >> numServers;
cout << "Average time between arrivals: ";
cin >> avgArvl;
for (int minutes = 0; minutes <= simLngth; minutes++)
{
if (minutes % avgArvl == 0)
{
c = Customer(count);
line.enqueue(c);
count++;
}
}
cout << "Queue contains: " << endl;
line.display(cout)
return 0;
}
and Customer class just has a default constructor and a constructor Customer(int newCustomer) which sets the private data member int customer to newCustomer. Thanks in advance for any help!

New Topic/Question
Reply




MultiQuote






|