This question already has an answer here:
- Structs with pointer to next struct 4 answers
I want to have a session where I insert totally 10 different integers in the size variable that is inside the linked list. I believe I should use result_register() for this?
When all 10 integers are stored I want to print them out by typing result->size.
I am new with linked lists so please be gentle.
struct result {
int size;
};
struct result* result_next()
{
// What do I type here?
}
void result_register(int size)
{
// What do I type here?
}
main
struct result* result;
while ((result = result_next()))
printf("%d\n", result->size);
Then I want to be able to print out the results by doing like above.