The problem of structure pointers as function parameters?

void ListDelete(LinkList *q,LinkList *p){
    (*q)->next=(*p)->next;
    free(*p);
    (*p)=(*q)->next;
}

and then directly ListDelete (& pjingheq) will be fine.
but my head pointer is also passed directly, (LocateElem (Linklist head.)). Deleting elements here does modify the linked list in the main function. Why

CPP c
Jul.29,2021

the first post was reviewed for nearly 12 hours. In other forums, dalao helped me solve the
problem. The
problem lies in pairq-> next in the ListDelete function. This is the assignment of the parameter address, which cannot modify the p point in the locateElem function at all. You can change the value of the address it points to through the parameter pointer, rather than directly modify the value of the parameter pointer.
it would be even better if dalao could help analyze how secondary pointers solve this problem!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b668-412d0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b668-412d0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?