Queues
Finite Queues
What happens when you read from empty queue?
Well, that depends on the what type of que it is. As in, lets say if the que is of the pre defined data type like int, real and others.. the return value will be '0'.
If the que is of a class or any dynamic objects, then the return value will be null.
a inta[$];
int fintq[$:2];
In the above code, when you pop empty que of class a, then the return value will be NULL pointer
When you pop from the Int que, the result will be '0'
int fintq[$:2];
Comments
Post a Comment