try and catch, 2 classes
<p>I have a function using <code>try-catch</code>. so I want use and another class to print out different kind of messages. What should I do? </p>

<p>I use namespace <code>std</code>. I'm new at this an not familiar with using namespace <code>std</code>. Please guide me thanks.</p>

<pre><code>SparseException::SparseException ()
{ }

SparseException::SparseException (char *message)
{ }

void SparseException::printMessage () const
{ 
   // ... 
}

try
{
    //did some stuffs here.
}
catch (exception e)
{
    char *message = "Sparse Exception caught: Element not found, delete fail";
    SparseException s (message);
    s.printMessage();
}
</code></pre>
