hallo
hab eine frage bezüglich try und catch....wie funktioniert das Kann mir das bitte jemand erklären, wann das programm wohin springt. Vielen Dank.
hab eine frage bezüglich try und catch....wie funktioniert das Kann mir das bitte jemand erklären, wann das programm wohin springt. Vielen Dank.
PHP:
#include<iostream>
using namespace std;
int main() {
try {
for (int i=0; i<7;i=i+1) {
if ((i%3)==2) throw i;
if (i%5) throw double(i);
cout<<i;
}
}
catch(int err) {cout<<err/2;}
catch(double err) {cout<<err/2;}
catch(...) {cout<<"Ooooops";}
return 0;
}
Gesucht ist die Ausgabe