Re-implement your grid class to use a template, and provide iterators or an interator-like abstraction of a pointer to an element (that supports the iterator operators begin(), end(), ++, --, and *.
Your grid class template should be instantiate as Grid
I will provide a sample application that will use your classes.