All Questions
Tagged with pointer-to-pointer linked-list
13 questions
1
vote
3
answers
135
views
Deleting one node of single linked list use double pointers in C language
I have been reading something related to C language's double pointers, and I have some doubts about the following piece of code. The following piece of code is about the operation of deleting a node ...
0
votes
1
answer
79
views
Question about argument in a function as a pointer to a pointer
I am reading the book "C Programming: A Modern Approach" by KN King, where in chapter 17.5 on page 432 they define a function for deleting a node from a singly linked list:
The following ...
0
votes
1
answer
134
views
inserting node at the beginning of a circular linked list using void function
I m trying to insert a node at the beginning of a circular linked list using a void function.
When i pass pointer to pointer head in the function because i have to change the head itself, it is ...
0
votes
1
answer
74
views
Deleting head node of a linked list in C where every node knows its headlist
typedef struct node {
int x;
struct node *next;
struct node **head;
} node;
Considering this struct, I've implemented a push function:
node *push(node *nodo, node *top) {
nodo->...
-1
votes
1
answer
253
views
Linked list program only printing last two nodes of list
I wrote a program to create and print a single linked list. I have used structure pointer to structure pointer for modifying the list. When I print the list it only prints last two nodes added.
#...
1
vote
2
answers
79
views
Trying to reverse a linked list using recursion and pointer to pointer but reversell function not giving expected proper output
I was trying to reverse a linked list using recursion and pointer to pointer but reversell function is not working properly as expected. Only reversell function has some problem all other functions ...
0
votes
0
answers
119
views
Chain List, story of pointers
I have this following code:
void pushInList(t_chan **chan, char *name, char *nick_user)
{
t_chan *new_channel;
(void)nick_user;
if ((new_channel = malloc(sizeof(t_chan))) == NULL)...
0
votes
0
answers
453
views
Insertion in doubly linked list C++
I've been working a lot with double pointers to solidify my knowledge of what they are and how I can use them, and I recently ran into a very weird problem. I'm trying to write code to insert a node ...
0
votes
2
answers
633
views
Iterative loop through linked list
This simple program creates a linked list that has an acronym and its complete phrase. There are two functions:
The first one creates a node and if the list is empty it puts the node in the first ...
1
vote
6
answers
1k
views
how to use a pointer to pointer to insert in a linked list
Think is a function to insert new element in the order of name.
I knew how to do it if I use a if to separate condition of inserting at the start and others. But I was asked to merge the if and while ...
0
votes
3
answers
90
views
confused with pointer to pointer concept
Passing a pointer is basically like passing a pointer as value.. the changes to the pointer internally in the function will not modify the actual value of the pointer.. but when we need to access on ...
-1
votes
3
answers
1k
views
linked list implementation using pointer to pointer in C
I am unable to append a new node in the linked list. I have already identified the problem area but after much research and trying many things I am still unable to resolve the issue.
The problem is ...
0
votes
2
answers
46
views
PointerToPointer : How to return the modified values/structure back to the original list?
While writing the add function for Linked List I came up with the following piece of code
int addNode(node ** head)
{
1. node * ptr = *head;
if(ptr==NULL)
{
...