Linked List Stack Implementation
while (1)
{
cout << "New Cat’s age ? (0 to Quit: ";
cin >> age;
if (!age)
break; // ends the loop
pCat= new Cat(age); // creates a pointer to a new Cat
pNode = new Node(pCat); // creates pointer to new Node
pHead->Push(pNode); // pushes item down on stack
} // END OF LOOP
Previous slide
Next slide
Back to first slide
View graphic version