Thanks for your reply. But I did initialize list->count in new.c...
void CreatList(List *list){
list = (List*)malloc(s izeof(List));
if(list==NULL) Error("No memory available.");
list->head = list->tail = NULL;
list->count = 0;
}...
User Profile
Collapse
-
Why I got such weird results for a simple linked list test?
Hi All, I've been testing some extremely simple code about a linked list.
What I keep doing is actually writing some parts of a linked list and testing them.
Below are my codes:
---------------------------------------------------------------------------
/* new.h */
#ifndef NEW_H
#define NEW_H
typedef int ListEntry;
typedef struct listnode{
ListEntry...
No activity results to display
Show More
Leave a comment: