Skip to content

question about your remove function #3

@atv2016

Description

@atv2016

Hi Karlina,
What does p=q do ? Does p stand for pointer and q for query?

while (q)
{
if (count == position)
{
p -> next = q -> next; <- This i get
delete q;
listLength--;
cout << "Success: node at position " << position << " was deleted." << endl;
cout << "listLength = " << listLength << endl;
return true;
}
p = q; <- What is happening here?
q = p -> next;
count++;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions