Created
January 25, 2013 21:49
-
-
Save johnsogg/4638191 to your computer and use it in GitHub Desktop.
seg fault is somewhere
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It gives the same message even when I comment out everything in the remove function (except the brackets so that the driver will run).