Math Exception Problem

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <exception>

using namespace std;

main(){
	try{
		int x = 1;
		int y = 0;
		int z = x / y;
	}
	catch(exception& e){
		cerr << "exception caught: " << e.what() << endl;
	}
	system("PAUSE");
}


why that program cannot show the error message?
Second result for google search "c++ divide by zero".
http://www.jdl.co.uk/briefings/divByZeroInCpp.html
Topic archived. No new replies allowed.