title: Passing an SDL_Window* struct to a function using address of in C
body: <p>My goal here is to make creating new mini windows or just separate windows take less code.
  Instead of:</p>
  <pre><code>SDL_Window* window = SDL_CreateWindow(&quot;Hello World&quot;, 
                                        SDL_WINDOWPOS_UNDEFINED, 
                                        SDL_WINDOWPOS_UNDEFINED,
                                        h, w,
                                        flags);
  </code></pre>
  <p>It would be more like:</p>
  <pre><code>SDL_Window* message_box;
  createMessageBox(&amp;message_box, &quot;Message Box&quot;);
  </code></pre>
  <p>with the function createMessageBox:</p>
  <pre><code>void createMessageBox(SDL_Window* message_box, char title[10]) {
      const int MESS_WINDOW_HEIGHT = 240;
      const int MESS_WINDOW_LENGTH = 180;
      
      Uint32 message_box_flags = SDL_WINDOW_SKIP_TASKBAR | SDL_WINDOW_ALWAYS_ON_TOP;
      message_box = SDL_CreateWindow(title, 
                                     SDL_WINDOWPOS_UNDEFINED,
                                     SDL_WINDOWPOS_UNDEFINED,
                                     MESS_WINDOW_HEIGHT,
                                     MESS_WINDOW_LENGTH,
                                     message_box_flags);
  }
  </code></pre>
  <p>But my problem is I get an error:</p>
  <pre><code>error: cannot convert SDL_Window** to SDL_Window*
  createMessageBox(&amp;message_box, &quot;Message Box&quot;);
                   ^~~~~~~~~~~~
  </code></pre>
  <p>I have zero idea about what the compiler is talking about here.
  What is <code>SDL_Window**</code>. I tried looking around online but couldn't find anything about it.</p>
  <p>As far as I'm concerned this should work?</p>
  <p>Full error:</p>
  <pre><code>g++ main.c -w -lSDL2 -o test
  main.c: In function int main():
  main.c:64:19: error: cannot convert SDL_Window** to SDL_Window*
      createMessageBox(&amp;message_box, &quot;Message Box&quot;);
                       ^~~~~~~~~~~~
  main.c:12:35: note:   initializing argument 1 of void createMessageBox(SDL_Window*, char*)
      void createMessageBox(SDL_Window* message_box, char title[10]) {
                            ~~~~~~~~~~~~^~~~~~~~~~~
  make: *** [Makefile:19: all] Error 1
  </code></pre>
  <p><strong>p.s I already know about SDL_ShowMessageBox that's not really what I'm looking for.</strong></p>