Exception Handling - set_unexpected() not able to call
<pre><code>#include "iostream"
#include "conio.h"
#include "exception"
#include "cstdlib"
using namespace std;

void myunexpected () 
{
    cerr &lt;&lt; "unexpected called\n";
    throw 0;     // throws int (in exception-specification)
}

void myfunction () throw (int) 
{
    throw 'x';   // throws char (not in exception-specification)
}

int main (void) 
{
    set_unexpected (myunexpected);
   try 
   {
      myfunction();
   }
   catch (int) { cerr &lt;&lt; "caught int\n"; }
   catch (...) { cerr &lt;&lt; "caught other exception (non-compliant compiler?)\n"; }
   getch();
   return 0;
}
</code></pre>

<blockquote>
  <blockquote>
    <p>Output(When executed on Visual studio 2008):
    caught other exception (non-compliant compiler?)</p>
    
    <p>But, I was expecting the output to be:</p>
    
    <p>unexpected called</p>
    
    <p>caught int</p>
    
    <p>NOTE: I executed this program on Visual Studio 2008.  </p>
  </blockquote>
</blockquote>
