title: How would I change my approach to useing the address of a temporary object?
body: <p>In creating the mouse events to click in a rectangle, how would I reformat the if statement so that I no longer get an error for taking the address of a temporary object of type 'SDL_Rect'.</p>
  
  <pre><code>//Get the mouse offsets
  x = event.motion.x;
  y = event.motion.y;
  SDL_Point point ={x, y};
  bool isPointInTileMap = false;
  
  for (int i = 0; i &lt; TILE_HEIGHT; i++ )
  {
      for (int j = 0; j &lt; TILE_WIDTH; j++) 
      {
          if (SDL_PointInRect(&amp;point, &amp;(tileMap_[i][j].getBoundRect())))
          {
              isPointInTileMap = true;
              break;
          }
      }
  }
  </code></pre>