Hello all.. was wondering if someone could tell me how this linked list is linked together. I've tried drawing memory pictures and have gone over it a thousand times and can't understand it. For some reason it prints the input 3 1 4 1 5 backwords. If u can show me how they are linked together. Thank you.

/*
Linked lists: sections 12.8 through 12.12.
Try 3 1 4 1 5.
*/

#include <stdio.h>
#include <stdlib.h>

struct intlist {
int data;
struct intlist *next;
} ;

int main(void)
{
struct intlist head = { 0, 0 };
struct intlist *t;
int n;

while (scanf("%d",&n) == 1) {
t = (struct intlist *) malloc(sizeof(struct intlist));
if (!t) { fprintf(stderr,"fatal: out of memory\n"); exit(1); }

t->data = n;
t->next = head.next;
head.next = t;
}

for (t = head.next;t;t = t->next)
printf("%d\n",t->data);

exit(0);
}