@laserlight
Your advice regarding the structure has been very helpful.
The "traditional" pointer approach makes more sense in my scenario.
However I'm now encountering errors trying to refer to members of the record structure.
Code:
void print_list(node_t *node_list) { node_t *current = node_list;
printf("\n");
while (current != NULL) {
printf("Key: %s\n", current->key);
while (current->record_list != NULL){
printf("Detail: %s\n",current->record_list.c_detail1);
// printf("Value: %d\n",current->record_list.i_value);
printf("\n");
current->record_list = current->record_list.next;
}
current = current->next;
}
}
This line
Code:
printf("Detail: %s\n",current->record_list.c_detail1);
Has error
Code:
error: request for member ‘c_detail1’ in something not a structure or union|
Clearly there is something wrong here, but this still looks correct to me ??
Can you see what the problem is, or advise a process that I could follow to figure it out myself?