How to declare an array of structure pointers? I need to create a collection of linked list. Is it same as declaring ordinary arrays? If
1 Answer
It is the same as everywhere else. If your struct is for example struct node
, an array of pointers would be for example struct node *myarray[ARR_LENGTH]
(assuming ARR_LENGTH
to be a constant meaning the array length)
If you typedef'd your struct, you could obviously use that type instead.