#include <iostream>
#include <string>
#include <exception>

using namespace std;

class rechnen
{
public:
   double division(int divident, int divisor);
};

double rechnen::division(int divident, int divisor)
{
  double erg;

  if(divisor==0)
  {
    throw "Divisor darf nicht 0 sein!";
  }

  erg=divident/divisor;

  return erg;
}


int main()
{
   rechnen Obj;

   try
   {
      Obj.division(2,0);
   }

   catch(char const* e)
   {
     cout<<"Fehler: " << e << endl;
   } 
}