I'm afraid that there are quite a few conceptual errors here.
To address your immediate question: your fruit class can't understand the "basket" it is in, so it's not reasonable to ask it to work on the basket.
When you say
fruit apples[2];
you are making two apple objects, each of which has an eat() method (I'll come back to that in a moment, because I'm not sure that makes sense) and then put them into an array. The array itself (I refered to it as a basket before) holds apples but does not have any eat() method. The apples do not have any knowledge that they are in the array. So in order to eat the apples you need some code to traverse the array (forgive this syntax, it's years since I wrote c++)
for ( int i = 0; i < 2; i ++ ){
apples[i].eat();
}
Now the question is where should that code go? And this is fundamental to the idea of OO programming, you think about what objects could reasonably "understand" this kind of operation, have responsibilities for looking after fruit. And hence you might have a Basket class, or some such.
Now onto the next object
fruit pie;
pie.eat();
Some problems here, first of all a pie is surely not a fruit. Consider all the things a fruit can do, and all the things a pie can do, they are very different - OK, you can slice them both, and eat them both, but they are no more similar than any other food. When you create classes you look for key similarities: Apples, Oranges, yep they have useful similarities perhaps, so Fruit as a class makes sense.
Second problem, I think you're expecting pie.eat() to have some effect on the array of apples. But these are completely distinct object. Two objects of the same class do not usually know ablout each other (there's some advanced techniques for making that possible, but don't even think about this now).
Now onto the final and I think most crucial point: the eat() method. In my world apples don't eat things, nor do they eat themselves. When doing OO, to a large extent you are modelling the real world. When you get something like this, a method that doesn't really correspond to the objects in question it probably implies that there is another class of objects we haven't identified yet.
It's not clear what kind of actions you are modelling. If you are tracking your inventory of fruit then you might have a Basket class. With methods such as
addFruit( arrayOfFruit);
takeFruit( what kind of fruit I want);
howManyFruit(kind of fruit);
If you are modelling calorie consumption you might have methods on Fruit
calories = takeOneBite();
biteLeft = howManyBitesLeft();
So we need to understand what you really want to do with the fruit before we can help further.