So I have the following toString function:
/*
* Function: toString
* Description: traduces transaction to a readable format
* Returns: string representing tr
You've defined a local variable pointer (edit thanks) inside that function and are trying to return it.
That's a no-no, as the variable's lifetime is only that of it's enclosing scope, here, the function call. Anyone trying to reference the return value will trigger undefined behavior, usually a crash, if you're lucky.
If you want to return the array, you need to pass it in as an argument.