Catch all type of assertion
<p>I need condition like:</p>

<pre><code>try
{
//bug condition
}
catch()
{
//Remove file
}
</code></pre>

<p>That is I create one very confidential file which data cannot be viewed by third party, but when any bug occurred in code my file is delete because I don't known exactly, where bugs occurred.</p>

<p>So I want to catch that bug using try and catch and want to delete that file. How can I  catch any exception in c++??</p>

<p>That will delete file if there is an bug.</p>

<p>Like:</p>

<pre><code>try
{
    char TempArray[10];
    char c = TempArray[11];
}
catch
{
    cout&lt;&lt;"Array out of boundry";
    deleteFile("Confi.txt");
}
</code></pre>
