Ok first of all, my statement needs to print like this.
Code:
Second 0:
Running: No Jobs
Queue 0: Empty
It is a queue which is actually 3 arrays at the moment I just want to print wait[0]
like this
Code:
#include <iostream>
#include "queue.h"
using namespace std;
int main() {
string jobname;
int subtime, priority, runtime;
int itemstoProccess=0;
const int NUM_QUEUES = 4;
const int MAX_RUNNING_TASKS = 2;
const int MAX_INPUT_JOBS = 20;
Queue wait[NUM_QUEUES];
struct RUNNING {
JOB job;
int elapsed;
} running[MAX_RUNNING_TASKS];
struct INPUTJOBS {
JOB job;
int priority;
} inputJobs[MAX_INPUT_JOBS];
while(cin >> subtime>>jobname>> priority>> runtime)
{
inputJobs[subtime].job.jobName=jobname;
inputJobs[subtime].job.runtime=runtime;
inputJobs[subtime].priority=priority;
itemstoProccess++;
}//end while cin
for( int sec=0; itemstoProccess!=0; sec++)
{
cout << "Second "<<sec<<":"<<endl;
cout << " Running: ";
if(running[0].job.jobName=="" && running[1].job.jobName=="")
{
cout << "No Jobs"<<endl;
}
cout << " Queue 0: " << (wait[0].displayAll());
//wait[0].displayAll();
itemstoProccess--;
}// end sec for loop
} // end main
my displayAll() function is written like this.
Code:
void Queue::displayAll()
{
if (isEmpty()) cout << "Empty." << endl;
QueueNode *temp = frontPtr;
while (temp!= NULL)
{
cout << temp->item.jobName;
temp = temp->next;
}
} // end display
I get this error message:
error: no match for 'operator<<' in 'std:perator<< [with _Traits = std::char_traits<char>](((std::basic_ostream
<char, std::char_traits<char> >&)(& std::cout)), ((const char*)" Queue 0: ")) << wait[0].Queue::displayAll()'
thanks for looking