I have a concept question I suppose. When I need to create a linked list, but I am just given a pointer to a struct (and the struct contains some data type and pointer "next"). How would I ensure that I am creating the other links and not just the root node? I am not using malloc or else this would be more apparent answer. This list is acting as malloc itself.
Thanks in advance!
To Clarify:
There will be single dimension array which will act as a block of memory of fixed sized. The linked list will then "allocate" by removing a node and putting it into the array or "free" data by removing it from array to add back to list.
example
(struct defined by some data type and pointer) struct is called node
node array[10]; //this acts as memory
node* linked_list; //this gives or removes data to memory (array)
malloc
, you can use a global variable for the root and test whether it is NULL. The question is unclear… – Potatoswatter