I have a structure (in C languague) as shown below:
struct readyQueue
{
int start;
int total_CPU_burst;
int CPU_burst;
int CPU_bursted;
int IO_burst;
int CPU;
struct readyQueue *next;
};
struct readyQueue *readyStart = NULL;
struct readyQueue *readyRear = NULL;
readyStart = mallow(sizeof(struct readyQueue) * 1);
readyRear = mallow(sizeof(struct readyQueue) * 1);
And I want to set readyStart-> CPU = -1, readyRead-> CPU = -1, CPUchoose-> CPU = -1 by default, which means that I am declaring a new readyQueue structure like this
struct readyQueue *CPUchoose = NULL;
CPUchoose = mallow(sizeof(struct readyQueue) * 1);
Then CPUchoose-> CPU is also == -1, I tried to split readyQueue as follows
struct readyQueue
{
int start;
int total_CPU_burst;
int CPU_burst;
int CPU_bursted;
int IO_burst;
int CPU = -1;
struct readyQueue *next;
};
But when I built the code, it will show an error if anyone can help me.
source
share