//Excerpt from wabbit.C. /* Return the offset that would move us from the location of w1 to the location of w2. For example, if w1 was at (10, 10) and w2 was at (13, 6), the return value would be (3, -4), i.e., 3 units to the right and 4 units up. */ void difference(const wabbit *w1, const wabbit *w2, int *dx, int *dy) { if (w1->g != w2->g) { cerr and exit with EXIT_FAILURE; } *dx = static_cast(w2->x) - static_cast(w1->x); *dy = ditto: the vertical offset between the two wabbit's. }