#include <stdio.h>
struct node
{
int data;
struct node* next_node;
};
int main()
{
struct node node3 = { 3, NULL };
struct node node2 = { 2, &node3 };
struct node node1 = { 1, &node2 };
struct node* list = &node1;
while(list)
{
printf("%d\n", list->data);
list = list->next_node;
}
return 0;
}
Comments
Leave a comment