title: c++ expected type-specifier before '…' token exception
body: <p>I have this code and it gives me this error:</p>
  
  <blockquote>
    <p>expected type-specifier before 'ToolongString' token.</p>
  </blockquote>
  
  <pre><code>#include &lt;iostream&gt;
  #include "student.h";
  #include &lt;exception&gt;
  
  using namespace std;
  
  int main()
  {
      student stud1;
      int a,b;
      string c,d;
      cout&lt;&lt;"Enter the First Name"&lt;&lt;endl;
      cin&gt;&gt;c;
      try
      {
          stud1.setFirstName(c);
          cout&lt;&lt;"Family Name: "&lt;&lt;stud1.getFirstName()&lt;&lt;endl;
      }
      catch (ToolongString ex1)//error
      {
          cout&lt;&lt; ex1.ShowReason() &lt;&lt;endl;
      }
       return 0;
    }
  </code></pre>
  
  <p>and this is the TooLongString class:</p>
  
  <pre><code>class ToolongString{
  public:
  
      char *ShowReason()
      {
          return "The name is too long";
      }
  
  };
  </code></pre>
  
  <p>and I have a header file of the class student like this:</p>
  
  <pre><code>#ifndef STUDENT_H
  #define STUDENT_H
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  
  using namespace std;
  
  class student
  {
  
   public:
      student();
      virtual ~student();
      int studentId,yearOfStudy;
      string firstName,familyName;
  
      void setFirstName(string name);
      void setFamilyName(string surname);
      void setStudentId(int id);
      void setYearOfStudy(int year);
      string getFirstName();
      string getFamilyName();
      int getStudentId();
      int getYearOfStudy();
      };
      #endif /
  </code></pre>
  
  <p>In the student.cpp file a I have other exceptions like that one.</p>