| | |
linked stack question.
![]() |
•
•
•
•
Originally Posted by yaan
I've used linked lists before. Does anybody have a resource or url address on how to write a linked stack? I need to create a stack with a menu using int and char variables.
Thanks.
Creating a linked stack is simple, if you've already written a linked list:
Step 1. Write a linked list.
Step 2. Create a function for pushing an element onto the front of the list. Call this 'push'.
Step 3. Create a function for removing the first element of the list. Call this 'pop'.
Step 4 (optional). Create a function that returns the first element of the list by reference, so it can be used as an lvalue. Call this 'top'.
Viola, you have a linked stack! And of course, with 'function', you can interpret that as 'member function' or 'method': whatever suits you.
•
•
Join Date: Jun 2005
Posts: 33
Reputation:
Solved Threads: 1
yeah
the switch statment shud solve all ur probs..
for any source code u want i think the best site is
www.planetsourcecode.com
u ll get everything in tht site..
the switch statment shud solve all ur probs..
for any source code u want i think the best site is
www.planetsourcecode.com
u ll get everything in tht site..
![]() |
Similar Threads
- linked list question (C)
- linked stack question (C++)
Other Threads in the C Forum
- Previous Thread: Random Number Guessing Game
- Next Thread: Help me in Round Robin Algorithem& Shortest remaining time next
| Thread Tools | Search this Thread |
#include adobe ansi api array asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic execv feet fgets file fork forloop frequency function getlasterror givemetehcodez global grade graphics gtkgcurlcompiling hacking hardware highest histogram i/o include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue mysql number odf opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf segmentationfault sequential shape socket socketprograming standard string systemcall threads turboc unix user voidmain() wab windows.h windowsapi






