блок catch() не работает c++
Здраствуйте!!! Использую в своей программе конструкцию try{}catch(){} и по какой-то причине при возникновении ошибке блок catch просто пропускается. Пишу на с++. Что мне делать? Код:
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <exception>
#include <thread>
#include <Windows.h>
#include <exception>
using namespace std;
short* number;
int main() {
setlocale(LOCALE_ALL, "ru");
try {
printf("...");
scanf("%i", &number);
}
catch (exception ex) {
printf("error:%s", ex.what());
}
return 0;
}