I created this class, say, Apple, and it has an overloaded operator [].
Then in another class, I made an array of apples, Apple stack[10].
Then when I was using stack[2] in an expression, instead of stack[2] being an object, the compiler is acting like it sees stack as stack[0], and then calling the operator [] and its parameter as 2.
Could you suggest a way I could calling stack[2] without being that way?
stack[2]should indeed give you the thirdAppleobject. You should post your code - preferably, a simplified version that only includes the code that is necessary to demonstrate the problem.