title: Pathfinding in a grid system
body: <p>I'm currently building a small grid-based game in C++ using SDL. I've made a tile class, which represents each individual tile on a map. This tile class is used in a 2 dimensional vector, one dimension representing the X axis and the other one the Y axis.</p>
  
  <p>I'm having an algorithm issue, I do not even know where to start with this, let's say I have this map:</p>
  
  <pre><code>0 0 1 1 0 E
  0 0 0 1 0 1
  0 C 0 1 0 1
  0 1 0 1 0 1
  0 1 1 1 1 1
  </code></pre>
  
  <p>C is my character, E is an exit, and 1 is a floor tile.</p>
  
  <p>I would like to figure out the most optimal way to figure out if there's a way for the character to reach the exit. I know I could use a function to manually check every tile around C, and for every floor tile around C, I check again every tile around, until I find a consistent path to get to E, but that doesn't seem very optimal.</p>
  
  <p>Can I have a clue or some sort of direction in which to orient myself?</p>