The initializeStack(); statement causes the program to crash. if i changed it to stackTop = NULL; then this constructor runs fine, until i try to use otherStack thats been passed to copyStack. Then the compiler starts b1tchin' about
instantiated from `linkedStackType<Type>::linkedStackType(const linkedStackType<Type>& ) [with Type = int]' and some error about this
here is what i did in the copyStack method:
I also noted that in the copy constructor and the copyStack methods if i type otherStack(dot) that no code completion box comes up which leads me to believe that the otherStack is not being seen somewhere.
I did it this way so that if you traverse the stack with another pointer you don't break it down. I'm just "looking" at the elements and not changing them. The parameter is a CONST so changing the stackTop pointer won't work also if it was the case that i used stackTop, i would have had to re-create the "otherStack" because stacktop = stacktop->link cause you to loose track of the actual top of the stack... and as far as I'm concerned, it works. This is the most efficient way i could do it, don't know of any other way. Minimum effort, maximum result.