if i have
struct node
{ int data;
struct node* next;
};
and if i pass a pointer
struct node* ptr;
which is pointing to a memory location of struct type and if i pass this pointer to a function,say
fn(struct node* ptr); and modify the ptr->data part inside the fnt,then why isnt this change reflected when i return from the function…so my basic question is why is it behaving like i passed the data by value although i actually passed it using a pointer…
the issue is resolved if i use a double pointer. but i am curious to know why it doesnt work for a single pointer