Original Post
🔒 Locked
Printing the stack
Advertisement
Which stack are you talking about? If it''s the run-time stackframe, I couldn''t help you, but I''m sure that there is plenty of debugging information out there on the web. As for any stack implementation, like the post above me says, no. However, if you make your own stack code, just remember to have accessor functions that point at the first element in the stack, and have it built with a linked-list form so you could traverse through the stack without changing the location of any of the elements. If thats a no go, then setup a second stack, and do a
POP FROM A, PUSH TO B, REPEAT UNTIL A IS EMPTY,
POP FROM B, PRINT, PUSH TO A, REPEAT UNTIL B IS EMPTY.
But thats inefficient and you already stated that you didn''t want that.
-> Will Bubel
-> Machine wash cold, tumble dry.
POP FROM A, PUSH TO B, REPEAT UNTIL A IS EMPTY,
POP FROM B, PRINT, PUSH TO A, REPEAT UNTIL B IS EMPTY.
But thats inefficient and you already stated that you didn''t want that.
-> Will Bubel
-> Machine wash cold, tumble dry.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement