0

I have following struct:

typedef struct PCB_struct
    {
        Boolean valid;
        pid_t pid;
        pid_t ppid;
        unsigned ownerID;
        unsigned start;
        unsigned duration;
        unsigned usedCPU;
        processType_t type;
        status_t status;
        simInfo_t simInfo;
        unsigned size;              // size of logical process memory in pages
        int maxActivePages;
        int currActivePages;
        int activePages[maxActivePages];
        pageTableEntry_t *pageTable;
    } PCB_t;

This stuct will be initialized in method-call

void resetPCB (PCB_t *pcb)
{
    pcb->valid = FALSE;         
    pcb->pid = 0; 
    pcb->ppid = 0; 
    pcb->ownerID = 0;
    pcb->start = 0; 
    pcb->duration = 0; 
    pcb->usedCPU = 0; 
    pcb->type = foreground; 
    pcb->status = init;
    // pcb->simInfo;    // currently unused, 
                        // placeholder, but is not initialised
    pcb->size = 0;      // process has no physical memory allocated
    pcb->pageTable = NULL;
    pcb->maxActivePages = 2;
    pcb->currActivePages = 0;
    pcb->activePages = { 0 }; // this doesn't work
}

But for some reason I can't reach an array int activePages[maxActivePages], when I define a pointer to that struct. I'm using Visual Studio 2013. Am I doing something wrong?

0 Answers0