Thanks a lot everyone. :)
Type: Posts; User: Prateek Sarkar
Thanks a lot everyone. :)
Why exactly do we need double pointers as arguments here? Can't the same be achieved without it? Eg. instead of what you suggested,
node * head = &ptr;
head== ptr;
works the same way, or...
What does a *node_name hold? Since a node is a structure of multiple data types, what does *node_name fetch? I know int *c, *c would fetch the integer stored at address pointed to by c.
Here is a basic program for insertion at the beginning of a LL.
void insert( node **head, int item)
{
node *ptr;
ptr=(node *) malloc(sizeof(node));
ptr->info= item;
if( *head == NULL)...