Q: C++ access array element using a COORD struct? I was wondering if there is an easy way to access an element of a two dimensional array using a COORD struct.
for example:
COORD myCoord = {2,6};
TwoDiArray myArray;
myArray.at(myCoord) = 10;

I have no idea how to properly do this. Any suggestions?

A: You just have to define a proper function at():
class TwoDiArray {
   ...
   // assuming there is some 2-dimensional array representation arr
   public: 
      int& at(COORD c) noexcept { return arr[c.x][c.y]; }
};


A: I'm making the assumption that your TwoDArray type is a type you can't change and which is accessed - well - like a two dimensional array, e.g., an alias for a two dimensional built-in array (otherwise see @Jodocus's answer). You could implement an accessory taking an array reference and a COORD object:
template <typename Array2D>
auto at(Array2D&& array, COORD c) -> decltype(array[c.x][c.y]) {
    return array[c.x][c.y];
}

(I don't know the name of the COORD members)
You'd use the function like this:
at(myArray, myCoord) = 10;

