This may seem a pretty basic question but it has been bugging me
for the last couple of days. This question was on my end of year
C++ exam and was worth 4%. While I'm not too worried about
my grade, others in my class may be, and if the lecturer made a
mistake, it's policy that we get the marks for a correct answer if
we attempted it. Here goes:

Code:
class CoOrd
{
private:
    int m_nX;
    int m_nY;

public:
    CoOrd ();
    CoOrd (int nX, int nY);

    void someOp ();
};
Given the following global function,

Code:
void translate (int amount)
{
    m_nX += amount;
    m_nY += amount;
}
that adds a set value - amount - to the m_nX and m_nY member
variables of the CoOrd class defined above, what changes would
have to be made to the CoOrd class definition for this function to
work. You cannot change the translate function's implementation.

Thats the question, and the answer i guessed was to make
translate a friend of the class, thinking that it may be legal to
call the function off a class instance, but following the exam i
tried it out and it didn't work. The only alternative i can think
of would be to make translate a member of the class, but as the
question specifies, translate is global - wouldn't making it a
member in essence change its implementation?

Obviously translate cannot compile on its own as m_nX and m_nY
are undeclared locally, so is the question actually wrong or am I
really missing some other way of getting it to work? Thanks in
advance, I really appreciate any advice on this.