can somesone explain this part of a code in espcail the \"typedef void* Object;\
ID: 3558512 • Letter: C
Question
can somesone explain this part of a code in espcail the "typedef void* Object;" part
and also how you add a node at the beginning and at the end of a double linked list.
typedef unsigned int uint;
typedef unsigned long ulong;
typedef void* Object;
typedef struct _DNode{
Object data;
struct _DNode* prev;
struct _DNode* next;
} DNode;
typedef struct _DoubleLinkedList{
DNode* head;
DNode* tail;
uint length;
uint elementSize;
} DoubleLinkedList;
DoubleLinkedList* allocDList(uint elementsize)
{
DoubleLinkedList* returnPtrDoubleLinkedList;
/* allocate the memory for new linked list */
returnPtrDoubleLinkedList = (DoubleLinkedList*)malloc(sizeof(DoubleLinkedList));
/* initialise all the elements in the linked list */
returnPtrDoubleLinkedList->head = NULL;
returnPtrDoubleLinkedList->tail = NULL;
returnPtrDoubleLinkedList->length = 0;
returnPtrDoubleLinkedList->elementSize = elementsize;
return(returnPtrDoubleLinkedList);
}
Explanation / Answer
done
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.