In terms of types, NULL means "doesn't exist" (really, the pointer is pointing to memory address 0)
Example: If I create three instances of a type, I'll end up with something like this:
So, you can check to see if you've iterated off the end of the list by checking for NULL.
Example: If I create three instances of a type, I'll end up with something like this:
NULL <- Before First MyType | Instance1.MyType <- First MyType | Instance2.MyType | Instance3.MyType <- Last MyType | NULL <- After Last MyType
So, you can check to see if you've iterated off the end of the list by checking for NULL.