I'm new to c++ so please bear with me if my terminology and knowledge is off.
I'm trying to print out or retrieve the string jobName after passing the JOB to a queue. In queue.h I have:
struct开发者_如何转开发 JOB {
string jobName;
int runtime;
};
In queue.cpp I am trying to write the appropriate method:
void Queue::display(){
cout << frontPtr->job.jobName;
}
I'm completely clueless what to do. And yes, this is a small part of a school assignment. Right now, it says error: 'struct Queue::QueueNode' has no member named 'job'. So lost, please help.
The key will be in the definition of struct Queue::QueueNode
. Look there, and see what field it has that will give you a struct JOB
.
精彩评论