< previous page page_1064 next page >

Page 1064
currPtr = head;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
currPtr and head both point to the first node in the list.
1064-01.gif
while (currPtr != NULL)

cout << currPtr->component << ' ';
currPtr = currPtr->link;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
The loop body is entered because currPtr is not NULL.
The number 49 is printed.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
currPtr now points to the second node in the list.
1064-02.gif
while (currPtr != NULL)
cout << currPtr->component << ' ';
currPtr = currPtr->link;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
The loop body repeats because currPtr is not NULL.
The number 50 is printed.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
currPtr now points to the third node in the list.
1064-03.gif

 
< previous page page_1064 next page >