I have written a code to push things off a list and onto a queue or stack til the list is empty. The programs compiles and runs but it is not executing as it is suppose to. Can anyone please tell me what is happening and suggestions on what needs to be done to fix it, that is to move items successfully off the list and onto either a queue or a stack. Thank you
Your iteration over the list lst has some problem. You uses front() repeatedly in the while loop? In general we use iterator class to iterate over list,queue,stack etc.
It is a homework assignment and we were specifically asked not to use iterators. So I attempted to take the front off first store it in a string and then examine it ... then push it onto either a stack or a queue but maybe it is that this syntax doesn't work? It compiles but there is no output after the printed list