Oct 22, 2014 at 2:15am UTC
someone please help! how can I make the queue of type pcb
and how to access pid in other clases?
Last edited on Oct 22, 2014 at 4:24pm UTC
Oct 22, 2014 at 2:16am UTC
inheritance or make pid public and include class PCB in header
Last edited on Oct 22, 2014 at 2:17am UTC
Oct 22, 2014 at 2:23am UTC
okay I did this and included pcb.h in header file, still not working.
1 2 3 4
class PCB{
public :
int pid;
};
I'm trying to access it in functions of ready_queue.
Last edited on Oct 22, 2014 at 2:25am UTC
Oct 22, 2014 at 2:41am UTC
//
Last edited on Oct 22, 2014 at 4:24pm UTC
Oct 22, 2014 at 2:46am UTC
You cant access non static members like that..You have to return it by an object or make pid static..my previous answer was a bit incomplete..To put it plainly..all class members must be accesses through the class
Last edited on Oct 22, 2014 at 2:49am UTC
Oct 22, 2014 at 2:49am UTC
okay I made it static int *pid
but still not declared in scope.
Oct 23, 2014 at 3:23am UTC
solve the scope issue, include class for pid, call by classname.pid/classname->pid or by getter method ?
Last edited on Oct 23, 2014 at 3:25am UTC