|
From: Luigi S. <gi...@li...> - 2001-12-05 17:44:56
|
Hi, chromatonus 712 Mr. Hardman gave you the hints you asked for and his code is close to your approach, instead what I'm sending you relies on pointers though still using your idea of an array to store elements. I did not use the "conio" library but only standard I/O operations. You will not find too many comments because the code is fairly simple, I also have the stack not deal with singular events (such as pushing on a full stack or popping from an empty one), because I can't think of any approach that is different from terminating execution (too abrupt) or throwing an exception (not sure how to do that yet); instead I let the client check if these events are about to occur. Probably you will find my code too simple for your needs, but I hope you will appreciate it. At 02.28 30/11/01 +0000, chromatonus 712 wrote: >hi, may I know how to display elements and count the number of elements in >a stack defined below, without destruction? thank you very much! >... -- gisan gi...@li... |