when I'm trying to add a new node to my linked list the compiler stop working and fails to add the node , I can't find out the problem is it in the logic or in the syntax
struct Record* CreateNode() {
struct Record* PointerToRecord ;
PointerToRecord = (struct Record*) malloc(sizeof(struct Record*));
if (PointerToRecord) {
PointerToRecord->C = FillDataOfContacts();
PointerToRecord->Next = NULL;
PointerToRecord->Prev = NULL;
}
return PointerToRecord ;
}
struct Record* AddNode() {
if (Head == NULL && Tile == NULL) {
Head = Tile = CreateNode();
} else {
struct Record* Pointer ;
Pointer = CreateNode();
Tile->Next = Pointer ;
Pointer->Prev = Tile ;
Pointer->Next = NULL;
Tile = Pointer ;
}
}