I'm trying to build a structure called PROCESS in C, this struct should contain the ID(id) and waiting time (wt) of the process.
typedef struct PROC{
int id;
int wt;
}PROCESS;
PROCESS *pt = NULL;
Now I want to make more then one instance of this struct like an array. what I want to do is something like this':
PROCESS pt[10];
pt[0].id = 5;
pt[1].id = 7;
But I want to do it using dynamic memory allocation:
pt = calloc(2,sizeof(PROCESS));
pt[0]->id = 5;
What is my mistake?