I have a linked list in a template class. My function is trying to determine the length of this list, but it gets stuck in an infinite loop. I know that it traces back to the cursor pointer. When I watch the local variables, the IDE shows the value of cursor as "(" and it never changes. It is supposed to start out as the head pointer and iterate through the list until ultimately winding up as NULL. Here is the code:
(1) Yes
(2) No. I'm pretty sure that the problem is one of two things. Either I am not getting cursor set up correctly at the beginning, or it is not advancing. The part that says cursor->fore() is suppose to call