You can't free the memory of the array. Maybe the exercise mean you should somehow clear the data by setting everything to zero or if you have a size variable to keep track of the size maybe that should be set to zero. I don't know wha tthe exercise is about so your guess is probably better than mine.
The exercise says when user choose exit ,the program deletes the pile and then it is finished. My exercise is about a pile(max).(pile in a form of an array)