I would like to implement an array of linked lists (in order to implement a hash table).
I have a problem at the very beginning... I defined a linked list structure, and I initialized the array of linked lists like an array of pointer to a list : liste * Oblist[65003];
(Do i need to initialize it like this : liste * Oblist[65003] = {NULL};?)
And I want to get the list at the index 12121 (which is NULL for the moment), so I did
liste L = *Oblist[12121] ;
The program compiles without errors but when I run it I get a Segmentation fault (core dumped)
Here is the whole code :
typedef struct Doublet {char * car ; struct Doublet * cdr ;}* liste ;
liste * Oblist[65003];
int main(void){
liste L = *Oblist[32123] ;
return 0;
}
Thank you in advance ;)
typedefed pointer. You have an array of pointers to pointers of typestruct Doublet.