At 04:41 15/01/02 +0000, chromatonus 712 wrote:
>hi, here is my prgm, I can't run it on DEVC++, when I ran it on Borland
>the prgm stuck when I try to enqueue after I display_copy(queuetype S).
>the function that doesn't seem to be written correctly. If you can find
>the problem please reply asap, thank you : )
your code causes memory leaks, also the function "count" advances "myqueue"
(and not a copy of it); according to my little experience, these together
with the sequence of functions you actually call, could be the reasons of
the strange behavior you report.
I did not attempt to compile your code, instead I've attached a copy of it
with some of the points where I would make changes, I also added a tarball
with a program similar to yours, just in case you are curious.
In my opinion you should review the sections dealing with pointers and
dynamic memory of your textbook.
--
Luigi
gi...@li... |