Skip to content

Instantly share code, notes, and snippets.

@irrationnelle
Created November 5, 2015 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irrationnelle/92637b40db788152baaf to your computer and use it in GitHub Desktop.
Save irrationnelle/92637b40db788152baaf to your computer and use it in GitHub Desktop.
I used 'for loop' for finding certain Node, but my condition must be added 'Tail != NULL' in if statement. But I don't understand why I should use this condition.
Node* SLL_GetNodeAt(Node* Head, int location)
{
int i;
Node* Tail = *Head;
for(i=0; i<location; i++)
{
Tail=Tail->NextNode;
}
return Tail;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment