I don't want process to arrive into the device (printer, disk, cd/rw) if no processes exist, like if A hasn't been pressed yet, or t was pressed and all processes terminated. How to do this, I thought if(head <tail) should do it, someone please help!
so the c part, the head of the ready_queue is supposed to be moved to the tail of the device_queue.
So that's what my move_top() function does, moves the head of the ready_queue, now how to place it into the tail of the device_queue, so it askes for filename, location, readorwrite, filesize only if the ready_queue is not empty.
someone please help! so after I return temp; in my move_top() function, which is basically the head of my ready_queue; how can I move this onto the tail of device_queue?
Your code has some serious problems. I would begin by separating the logic for the queue from the logic for the program. You have no need for two different queue types.
You can't do if (head < tail), line 83, because neither head or tail variables exist in device_queue class, they belong to ready_queue class.
Also note that none of your vectors, that you create in deviceSetup will be saved after the function ends, as those are local variables for the function.
so what I'm trying to do is that if there are processes in the ready queue which have arrived, and if they haven't yet been terminated then this process will arrive into the device queue.
Add this function to ready_queue int ready_queue::getProcNum(){return head < tail;}
And now use it in device_queue like this if ( ready_queue::getProcNum() )
yes. I thought that if the head was less then tail then it should print error, because that means no process arrive, makes sense to me, but not working hmmmm.