Expand|Select|Wrap|Line Numbers
- #include <stdio.h>
- #include <unistd.h>
- #include <stdlib.h>
- #include <pthread.h>
- #include <time.h>
- #include <sys/time.h>
- #include <string.h>
- typedef int ProID;
- struct proDes {
- struct proDes *next;
- struct proDes *prev;
- char name[10];
- ProID pid;
- int priority;
- long waittime;
- struct intHeap *heap;
- struct LL *inlist;
- };
- struct intHeap{
- struct intHeap *ndata;
- char *dataname;
- int value;
- };
- typedef enum{RUNNING, READY, L_DYING} ListType;
- struct LL{
- struct proDes *head;
- ListType type;
- };
*NB: i have a linked list *lnode and want to sort its elements according to
waittime saving the sorted list in the new linked-list, inlist.
I tried this:
Expand|Select|Wrap|Line Numbers
- lnode->inlist->head = (struct proDes *)malloc(sizeof(struct proDes));