Skip to content

Instantly share code, notes, and snippets.

@johnsogg
Created January 25, 2013 21:49
Show Gist options
  • Save johnsogg/4638191 to your computer and use it in GitHub Desktop.
Save johnsogg/4638191 to your computer and use it in GitHub Desktop.
seg fault is somewhere
void remove(node** parent, int offset) {
node* cursor = *parent;
if (cursor->next==NULL || offset > size(*parent)) {
return;
} else if (offset==0) {
cursor=cursor->next;
} else {
for (int i=1;i<offset;i++) {
cursor=cursor->next;
}
cursor->next=cursor->next->next;
}
}
@coaw8679
Copy link

It gives the same message even when I comment out everything in the remove function (except the brackets so that the driver will run).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment