Files
CS-Classes/CS202/Notes/exceptionHandeling.cpp
2025-06-17 14:42:22 -07:00

31 lines
511 B
C++

/*
An exception is an exceptional circumstance
that arises at runtime
try => run code in protected env.
catch => catch an exception.
throw => thrown an exception
int x,y; // if y = 0
cin >> x >> y;
cout << x/y << endl;
//string to integer
string s = "10"
sstream = str(s);
int a;
if(str >> a){
//success
}else{
//failure
}
cpp refrecnce
cpp::out of range
we can create our own exception
//what//is virtual
*/