title: Declaration terminated Incorrectly error in following code in cpp
body: <p>Iam trying to develop C++ program for observer pattern but i am getting these errors.
  Here's my CPP code , and i getting error continuously : "Declaration termination incorrectly" !
  Thanks in Advance
  Help me please i am desperate.</p>
  
  <pre><code>#include&lt;iostream.h&gt;
  #include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  
  class Subject{
  public :        virtual ~Subject();
          virtual float attach()=0;
          virtual int notify()=0;
  };
  
  class Observer{
  public :        virtual ~Observer();
          virtual void update(int type, float amount, float bal)=0;
  };
  
  class Account : public Subject
  {
  public:  float attach()
   {
      char name[12];
      int account_no;
      float bal;
      cout&lt;&lt;"Enter the Name of Account Holder : ";
      cin&gt;&gt;name;
      cout&lt;&lt;"Enter the Account No. : ";
      cin&gt;&gt;account_no;
      cout&lt;&lt;"Enter the Balance of his account : ";
      cin&gt;&gt;bal;
      cout&lt;&lt;"The Name of Account Holder : "&lt;&lt;name;
      cout&lt;&lt;"The Account No. : "&lt;&lt;account_no;
      cout&lt;&lt;"The Balance of his account : "&lt;&lt;bal;
      return bal;
  }
  int notify()
  {
      int type;
      cout&lt;&lt;"\nMenu :\n\n1) Deposit\n2)Withdrawl\n";
      cout&lt;&lt;"Enter the type  for transition : \n";
      cin&gt;&gt;type;
      return type;
  }
  public: void update(int type, float amount, float bal)
  {
      char name[12];
      int account_no;
      if(type==1)
          bal=bal+amount;
      else if(type==2)
          bal=bal-amount;
      else
          cout&lt;&lt;"Oops! Transition Type is invalild....";
      cout&lt;&lt;"\nThe Details of Account Holder after Transition     :-\n";
      cout&lt;&lt;"The Name of Account Holder : "&lt;&lt;name;
      cout&lt;&lt;"The Account No. : "&lt;&lt;account_no;
      cout&lt;&lt;"The Balance of his account : "&lt;&lt;bal;
  }
  };
  
  class obpt{
  public : static void main()
  {
      Account ac;
      //AccountUpdate au;
      float balance, amt;
      int type;
      clrscr();
      cout&lt;&lt;"\nWelcome To The Program of Observer Pattern of Account Transition\n";
      cout&lt;&lt;"\nEnter the Details of Account Holder :-\n";
      balance = ac.attach();
      cout&lt;&lt;"\nCall notification for Deposit or Withdrawl Transition\n";
      type=ac.notify();
      cout&lt;&lt;"\nEnter the amount for transition : \n";
      cin&gt;&gt;amt;
      cout&lt;&lt;"\nAfter The transition the Main balance : \n";
      ac.update(type, amt, balance);
      getch();
  }
  }
  </code></pre>