how to access variable in different class

someone please help! how can I make the queue of type pcb

and how to access pid in other clases?
Last edited on
inheritance or make pid public and include class PCB in header
Last edited on
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
//
Last edited on
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
okay I made it static int *pid but still not declared in scope.
solve the scope issue, include class for pid, call by classname.pid/classname->pid or by getter method ?
Last edited on
Topic archived. No new replies allowed.