title: 'ControllerPosition' does not name a type
body: <p>In the following code, the avr-g++ (Arduino IDE) compiler throws the error: <code>'ControllerPosition' does not name a type</code>. What is the problem with the code? </p>
  
  <p></p>
  
  <pre><code>struct ControllerPosition
  {
    int y, x;
  
    ControllerPosition(int _y = 0x7FFF, int _x = 0x7FFF) : y(_y), x(_x) {}
  };
  
  ControllerPosition mapPosition(int input)
  {
    return ControllerPosition((input % 10) * 2 + 1, (input / 10) * 2 + 1);
  }
  </code></pre>