All pastes #730140 Raw Edit

XwZ

public text v1 · immutable
·published 2007-10-08 22:55 UTC
rendered paste body
#include <iostream>
#include <stdexcept>

using namespace std;

void fonction ( const int i ) throw () {
	if ( i == 2 ) {
		throw Out_Of_Range("Erreur") ;
	}
	cout << "i est ok" << endl ;
}

int main () {
	try {
		fonction (2) ;
	} catch ( const Out_Of_Range & e ) {
		cout << e.what() ;
	}
}