I have compiled my code codes but I do not understand what is happening from the output of the code
Code:
#include<stdio.h>
#include<stdlib.h>
struct Node{
int value;
struct Node *next;
};
struct Node * Add_Node( int data, struct Node *p ){
struct Node *new = malloc(sizeof(*new));
new-> value = data;
new->next = p;
printf("new : %p \n", new);
return new;
}
int main ()
{
struct Node *Ps = NULL;
printf("intial PS : %p \n", Ps);
Ps = Add_Node(12, NULL);
printf("first call PS : %p \n", Ps);
Ps = Add_Node(24, Ps);
printf("Second call PS : %p \n", Ps);
Ps = Add_Node(34, Ps);
printf("Third call, PS : %p \n", Ps);
Ps = Add_Node(44, Ps);
printf("fourth call, PS : %p \n", Ps);
Ps = Add_Node(54, Ps);
printf("fifth call PS : %p \n", Ps);
return 0;
}
intial PS : 00000000
new : 007D13A8
first call PS : 007D13A8
new : 007D13D8
Second call PS : 007D13D8
new : 007D0DD8
Third call, PS : 007D0DD8
new : 007D0DE8
fourth call, PS : 007D0DE8
new : 007D0DF8
fifth call PS : 007D0DF8