We've already told you how to do it. Pass a pointer to it. Also, stop typecasting malloc. Read the FAQ if you want to know why it's wrong.

Also, why do you think it should destroy any memory in your init function? You don't free anything there. You simply use what you're passing to it. Why would that be destroying anything?

Why are you making a new array inside of FindMaxValue? Oh, by the way, you don't actually free anything you allocate.


Quzah.