In other words, I tried and this is what I got. Correct?
Robot* otherRobotAt(Robot* rp) const
// If there is at least one robot (other than the one rp points to)
// at the same (r,c) coordinates as the one rp points to, return a
// pointer to the one of those other robots with the least amount
// of energy remaining (if there's a tie, any one of the tied robots
// will do); otherwise, return NULL.
//
{
for (int i = 0; i< m_nrobots; i++)
{
if ((m_robots[i] -> row()==r)
&& (m_robots[i] -> col()==c)
return this;
}
return NULL;
}