I would call it
'index', not
'iterator'.
Please note: you forgot to return a value to indicate the '
item not found' condition (incidentally this si far more important than choosing a convention on index usage).
This is my (personal) preference:
class A
{
private:
int m_aData[100];
public:
int findIndexOf(const int p)
{
for (int i = 0; i <100; i++)
if (m_aData[i] == p)
return i;
return -1;
}
};
:)