Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ObslugaBledow {
- int error;
- public:
- ObslugaBledow();
- ObslugaBledow(int);
- void print();
- };
- ObslugaBledow::ObslugaBledow()
- {
- error = 0;
- }
- ObslugaBledow::ObslugaBledow(int a)
- {
- error = a;
- }
- void ObslugaBledow::print()
- {
- if(error == 0)
- {
- cout << "Nie dosc ze sie wyjebalo, to jakis kutas nie ustawil kodu bledu." << endl;
- } else {
- cout << "Jezus Chrystus Nazarenski, wyjebalo sie z kodem bledu " << error << endl;
- }
- }
- // ...
- void Spierdol()
- {
- fstream plik;
- plik.open("Tego_Na_Pewno_Kurwa_Nie_Ma.txt");
- if(!plik.is_open()) throw ObslugaBledow(666);
- // ...
- if(!plik.good()) throw ObslugaBledow(667);
- // ...
- int zalozylem_gacie_na_lewa_strone = 0;
- if(zalozylem_gacie_na_lewa_strone) throw ObslugaBledow;
- }
- // ...
- int main()
- {
- try {
- Spierdol();
- } catch(ObslugaBledow blad) {
- ObslugaBledow.print();
- }
- }
Add Comment
Please, Sign In to add comment