title: Can a function continue after a return statement?
body: <p>Consider the following C++ function:</p>
  <pre><code>SDL_Surface* loadBMP(std::string path, SDL_Surface* loadedBMP){
      //Load bitmap
      SDL_Surface* loadedBMP = SDL_LoadBMP(path);
      if (loadedBMP == NULL){
          printf(&quot;Unable to load image %s! SDL Error: %s\n&quot;, path.c_str(), SDL_GetError());
      }
  
      return loadedBMP;
      
      //Magic
      SDL_FreeSurface(loadedBMP);
  }
  </code></pre>
  <p>Now, for the sake of this question, assume that <code>loadedBMP</code> is a previously declared global variable.</p>
  <p>Here is my question:<br />
  Is there a way to let a function continue running after a <code>return</code> statement? In terms of this function, is there a way to have the final line, <code>SDL_FreeSurface(loadedBMP)</code>, run after <code>return</code>ing <code>loadedBMP</code>?</p>