How the function fun is returning the pointer to the node created even though I haven't used any return statement. Consequently, the value in the nodes get successfully printed. How?
#include <stdio.h>
#include"stdlib.h"
struct node
{
int data;
struct node *next;
};
main ()
{
struct node *nl=fun();
printf("%d",nl->data);
}
fun ()
{
struct node *p= (struct node*)malloc(sizeof (struct node));
scanf("%d", &(p->data));
p->next=NULL;
}