title: My C program is correct, with no errors or warnings, but no window is displayed. Why?
body: <p>This is my code, with no errors or warnings. I don't understand where i'm wrong.</p>
  
  <p>It should show a window with a rectangle.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;SDL.h&gt;
  
  int main(int argc, const char * argv[]) {
  
  
      SDL_Window *window;     // Declare a window
      SDL_Renderer *renderer; // Declare a renderer
  
      SDL_Init(SDL_INIT_VIDEO); //Initialize SDL2
  
      //Create an application window with the fellowing settings:
      window = SDL_CreateWindow("Game Window",                                        // window title
                                SDL_WINDOWPOS_UNDEFINED,                             // initial x position
                                SDL_WINDOWPOS_UNDEFINED,                             // initial y position
                                640,                                                 // width, in pixels
                                480,                                                 // height, in pixels
                                0  );                                                // flag);
  
      renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
  
      //
  
      SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255);
  
      //Clear the screen (to blue)
      SDL_RenderClear(renderer);
  
      // set the drawing color to white
      SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
  
      SDL_Rect rect = {220, 140, 200, 200};
      SDL_RenderFillRect(renderer, &amp;rect);
  
      // We are done drawing, "present" or show to the screen what we have drawn
      SDL_RenderPresent(renderer);
  
      // Wait a few seconds before quitting
      SDL_Delay(2000);
  
  
      // Close and destroy the window
      SDL_DestroyWindow(window);
      SDL_DestroyRenderer(renderer);
  
      // Clean up
      SDL_Quit();
      return 0;
  
  }
  </code></pre>