My applet is supposed to detect palindromes (words that are spelled the same forwards or backwords, ie "radar"). GUI is named WordGUI. Stack class is named WordStack. I am trying to use the pop() with stacks. I was able to use the push() without problems. Basically, I'm accepting user input from a textfield in my WordGUI class and pushing each char onto a stack array named data. Then I need to pop the chars out of the data array into a new stack array called popped. I then need to compare the contents of the 2 arrays to see if they are equal. If they are - we have detected a palindrome. Mission accomplished. So... what am I doing wrong with my pop method? I think there's also a problem with my for loop that uses pop. Any ideas? Thank you.
[Dave fixed code tags] [ October 22, 2002: Message edited by: Dave Vick ]
Joined: May 10, 2001
Russ I noticed that you also posted this to several other forums - that is called "cross posting". Cross posting is bad. Most of the visitors here read more than one forum and it is frustrating to see the same question repeated over and over. You have a better chance of getting a correct and timely answer if you post it to the most appropriate forum instead of using the shotgun approach and hoping you'll hit something. thanks