#include #include #ifndef _WYJATKI_H #define _WYJATKI_H using namespace std; class Wyjatek { protected: string tekst; public: Wyjatek(const string s="Wystapil wyjatek\n"):tekst(s){}; virtual void Komunikat(){cout << tekst;} }; class BrakPamieci: public Wyjatek { public: BrakPamieci(const string tekst="Brak pamieci\n"):Wyjatek(tekst) {}; }; class ZlyIndeksWektora: public Wyjatek { public: int indeks; ZlyIndeksWektora(int i=-1,string k="Zly indeks wektora\n"):Wyjatek(k),indeks(i){}; void Komunikat(){ cout << tekst << "Indeks " << indeks << endl; }; }; #endif