Now, I have this project about using STACKS .. It is about a container that that hold some colors , after the user enter the colors he wants in the container , he will choose one of these color to remove from the container .. for example , if he types : Green Red Yellow Red White Black Yellow then he choose to remove the " Red " color !! I need to show the stack at the same order above after the color removal ! it will be : Green Yellow White Black Yellow |
|
|
myStack[7-6] = myStack[7];
|
|
viliml wrote: |
---|
Oh, and gaminic: TOTALY WRONG!!!! the is NO operator[] for stacks! the whole point of stacks is last in first out! Lets take iHutch105's example:a stack of plates. Your code would be taking a plate from the middle of the stack, and if you did that, the whole stack would fall and break! Oh and you can't modify the size of a stack directly, you have to pop it! I think you should go to the "beginners" sub-forum. You mightlear a LOT of new stuff. after a month or so studying there you can come back here and study the post here, and after another month or so you can start posting! DO NOT TALK ABOUT THINGS YOU DON'T UNDERSTAND!!! |
Oh, and gaminic: TOTALY WRONG!!!! the is NO operator[] for stacks! the whole point of stacks is last in first out! Lets take iHutch105's example:a stack of plates. Your code would be taking a plate from the middle of the stack, and if you did that, the whole stack would fall and break! Oh and you can't modify the size of a stack directly, you have to pop it! I think you should go to the "beginners" sub-forum. You mightlear a LOT of new stuff. after a month or so studying there you can come back here and study the post here, and after another month or so you can start posting! DO NOT TALK ABOUT THINGS YOU DON'T UNDERSTAND!!! |