Re: Queue problems


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Michael on April 22, 2001 at 13:48:51:

In Reply to: Queue problems posted by William Livingston on April 22, 2001 at 13:23:07:

Your list should be of pntrs so that you can use virtual functions. What you doing when you dereference is creating an animal object, not a browser object as might suspect.
: when i try to push my new creatures onto the queue i don't get an error, but it just inserts garbage. When i create 'temp3' it works correctly, but once i try to push temp3 it just passes garbage. Just so you know animals is a deque of Animal types. And temp3 is an Animal pointer to a new Browser object.

: animals.push_back (*temp3);

: Any help would be greatly appreciated.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]