C++ try / catch (new to programming and not much info about this clause)
<p>I am new to programming and am having trouble with try / catch clauses.</p>

<p>Here is an example from a textbook that I have:</p>

<pre><code>int main( ) 
{
   char *ptr;

   try {
      ptr = new char[ 1000000000 ];
   }

   catch( … ) {
      cout &lt;&lt; "Too many elements" &lt;&lt; endl;
   }

   return 0;
}
</code></pre>

<p>I have tried to look online for a further explanation and the textbook does not exactly tell me what what these clauses actually do or what it is used for.</p>

<p>Any information would be helpful.</p>

<p>EDIT: The textbook I am using is:
C++: Classes and Data Structures by Jeffrey Childs </p>
