Exception Handling problem in C++
<p>Hii , I am new to C++ programming and need some help regarding the code i wrote below....
Its a basic exception handling program </p>

<pre><code>#include&lt;iostream&gt;

class range_error
 {
      public:
    int i;
    range_error(int x){i=x;}
 } 

 int compare(int x)
  {
              if(x&lt;100)
                  throw range_error(x);
             return x;               
  }                

 int main()
  {
     int a;
     std::cout&lt;&lt;"Enter a  ";
     std::cin&gt;&gt;a;
     try
      {
         compare(a);        
         }
       catch(range_error)
        {
            std::cout&lt;&lt;"Exception caught";
            }
      std::cout&lt;&lt;"Outside the try-catch block";
     std::cin.get();
    return 0;                 
}      
</code></pre>

<p>When i compile this ... i get this ...</p>

<p>New types may not be defined in a return type at line 11.(at the start of compare function).</p>

<p>Please explain me what is wrong...</p>
