[EMAIL PROTECTED] wrote:
>Please tell me what is going wrong in my code.
You've declared these member variables:
> Queue *front, *rear;
But they're not static, so every instance of Queue is getting its
own copy. You need to declare them static (and initialize them to
NULL).
There's nothing wrong with your use of new. (In fact, the replacement
code is more of a problem because your constructor won't get called
without new.)
The remove code looks a bit funky though if it's meant to allow an
arbitrary link to be removed. For instance, it never fixes up rear
if there's more than one element in the list.
--
-M- [EMAIL PROTECTED]
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/