why is resource management order important?
<p>In Stroustrup's book The C++ Programming language, He mentions "It is typically important that resources are released in the reverse order of their acquisition" 
why the order is important?</p>

<pre><code>void acquire()
{
 acquire resource 1;
 ...
 acquire resource n;
 use resources;
 release resource n;
 ...
 release resource 1;
}
</code></pre>

<p>so what if we change the order as follow?  </p>

<pre><code>void acquire()
{
   acquire resource 1;
    ...
   acquire resource n;
   use resources;
   release resource 1;
    ...
   release resource n;
}
</code></pre>
