This here is a very big problem:
sprintf(myString, "%f", help); //double to string
stack[counter] = myString;
Here you set the pointer in stack[counter]
to point to myString
. But you forget that myString
will always be the same pointer, so whenever you change myString
all entries in stack
that points to myString
will be changed as it is all the same string.