The elements stored in a Queue object can be of any type, including other objects.
Write an application to simulate a queue of people going to the cinema. The user may
input "j" to join the queue, "l" to leave the queue or "e" to end the program.
When a person joins the queue, their name and age is input and stored in a queue of
Person objects.
This evening, the cinema is showing a film rated as 15. When a person leaves the front
of the queue, their age is checked and one of the following messages is output:
<name> has left the queue and has entered the cinema
<name> has left the queue, but is too young to enter the cinema
I made some improvements, but I am struggling to output whats in the Queue.
I get this error:
Severity Code Description Project File LineError C2679 binary '<<': no operator found which takes a right-hand operand of type 'Person' (or there is no acceptable conversion) 11t j:\private work\javatoc++\week 11\11t\11t\source.cpp 95
Thanks for the response, everything is working fine! I am quite intrigued on smart pointers (as I have never seen anything like that before) I assume it clears up the pointer memory automatically when the program ends.
Would you recommend any reading material with good easy explanations for beginners on smart pointers?