If a queue dynamically allocates memory to hold the queue, explain the reason for that occurence and state whether in such a situation it...

      

If a queue dynamically allocates memory to hold the queue, explain the reason for that occurence and state whether in such a situation it is possible to block one queue from being assigned to another.

  

Answers


Davis
If memory to hold a queue is dynamically allocated, assigning one queue to another causes the dynamic memory allocated to the queue on the left side of the assignment statement to be lost and the memory allocated to the queue on the right side to be freed twice when the the objects are destroyed.Either of these two conditions is an acceptable error.

Githiari answered the question on May 12, 2018 at 17:46


Next: What is wrong with the following fragment? //This program has an error. #include using namespace std; class c11 { int i, j; public: c11 (it a, int b) { i =...
Previous: As you know, when an object is passed to a function, a copy of that object is made.Further, when that function returns, the copy's destructor...

View More Computer Science Questions and Answers | Return to Questions Index


Exams With Marking Schemes

Related Questions