E
enki
I am trying to understand try throw and catch. I am trying to write a
simple demo porgram to see how it works. This is what I have so far:
#include<iostream>
using namespace std;
int main(){
int x;
try{
cin>>x;
}
catch(x){
cerr<<"Must be int!\n";
x = 0;
}
return 0;
}
simple demo porgram to see how it works. This is what I have so far:
#include<iostream>
using namespace std;
int main(){
int x;
try{
cin>>x;
}
catch(x){
cerr<<"Must be int!\n";
x = 0;
}
return 0;
}