I am trying to figure out what would be stored in "myList" at the end of this program? If anything since it looks like it removes everything from the front. Is that correct. If that is the outcome can I writea fuction to correct it?
Katie
template <class T>
void printList(List<T> L);
void main(){
List<float> myList;
myList.insertAtFront(3.4);
myList.insertAtFront(16.7);
printList(myList);
myList.insertAtFront(100.1);
}
template <class T>
void printList(List<T> L)
{
T answer;
while(L.removeFromFront(answer)) {
cout << answer << endl;
}
}