サンプル

int funct(){
int exception = 2;
if(exception){
throw exception;
}
return 0;
}

int main()
{
try {
funct();
}
catch (int ex) {
cout << ex;
}
   
return 0;
}

ソリューション
例外の参照をキャッチします。

int funct(){
int exception = 2;
if(exception){
throw exception;
}
return 0;
}

int main()
{
try {
funct();
}
catch (int &ex) {
cout << ex;
}
   
return 0;
}