Quote Originally Posted by exdox77 View Post
how much clearer can I get!

I want to extract the element number from the array with out using a separate counter:

I have and array of 3 apples

apples[3] = {'green','red','yellow'};

I have a for loop

for(i = 0; i <= 2; i++)
cout << "Element number is: " << /* I need the element number not the contents of the element */
<< "Contents of Element: " << apples[i];

return 0;


I cant really get much clearer than that sir
So i is the element number. Just cout i wherever you want it. If i isn't the element number, you need to explain what you mean by that term.