title: Declaring SDL_Rect data member crashes on launch, can't find why
body: <p>When I declare the following as a private data member of my main class "App", my program crashes on launch as if it was accessing invalid data/memory (EDIT: it doesn't crash if it is a public data member):</p>
  
  <pre><code>//Display position and dimensions of the entire app
  SDL_Rect DisplayRect;
  </code></pre>
  
  <p>If I remove this, program launches fine, but I really don't understand why. I verified the following things:</p>
  
  <ul>
  <li>SDL library was initialized correctly</li>
  <li>The "SDL_Rect" header is included</li>
  <li>The compiler throws no warning or error</li>
  </ul>
  
  <p>It doesn't make any sense, and I have private SDL_Rect data members in other classes and they don't cause any problem. I think it's something about initialization but I don't get why I should have to do anything special in this case. Here are all my data members and my initialization list for my App class:</p>
  
  <pre><code>/* Private data members */
  private:
  
  //Whether or not the app loop is running
  bool running;
  
  //The starting time of the program, starting when the App object is created
  clock_t start_time;
  
  //Variable holding count of loops executed after the App object entered its main loop - use the defined public method
  //to increase the count at the proper location inside the App object's main loop
  long long int loop_count;
  
  //SDL Window pointer to hold the main application window
  SDL_Window* MainWindow;
  
  //Event Manager object to check and manage main application events
  EventManager MainEvents;
  
  //SDL renderer pointer to perform rendering operations
  SDL_Renderer* MainRenderer;
  
  //App dependencies structure to be passed to lower level objects for dependency injection
  AppDependencies MainDependencies;
  
  //Room object holding data for the current room into which the App is running - initialize with default values
  Room CurrentRoom;
  
  //Display position and dimensions of the entire app
  SDL_Rect DisplayRect;
  
  
  /* Public methods */
  public:
  
  //Constructor - Initialization list
  App() :
  
      MainDependencies(this-&gt;MainWindow, &amp;this-&gt;MainEvents, this-&gt;MainRenderer),
      CurrentRoom(&amp;this-&gt;MainDependencies, RoomId::SPLASH_SCREEN, 1024, 768, 1024, 768)
  
      {
          //Set data member telling that the app is running
          this-&gt;running = true;
  
          //Get the starting time of the App object
          this-&gt;start_time = clock();
  
          //Set loop count to 0
          this-&gt;loop_count = 0;
  
          //Set MainWindow pointer to null
          MainWindow = nullptr;
  
          //Set MainRenderer pointer to null
          MainRenderer = nullptr;
      }
  </code></pre>