This is my attempt at that code to try and make it in terms of fitting it into mine, but no node is getting deleted but rather nodes are merely just getting rearranged. Could someone help please?

Code:
node *newnode = current;
node *temp;
node *start = current;

if (current -> num == x)
{
current = current -> shortlink;
delete newnode;
}

else

while (newnode -> shortlink -> num != start -> num)
{
if (newnode -> shortlink -> num == x)
{
temp = newnode -> shortlink;
newnode -> shortlink = newnode -> shortlink -> shortlink;
delete temp;
}
newnode = newnode -> shortlink;
}
if (newnode -> shortlink -> shortlink -> num == length && newnode -> shortlink -> num  == x)
{
delete newnode -> shortlink -> shortlink;
newnode -> shortlink = start;
}