I have seen several c++ projects written by seniors without any exception handling.
ex: I see : className* ptr = new className();
instead of :
try
{
className* ptr = new className();
//some code/throug exception
}
catch(bad_alloc ba) //or catch some other exception
{
//some code
}
Usually why people are leaving this try-catch block even if we know that there is chance of exception.
And one more thing, should we use this try/catch format when we are using new
?
When we should go for exception handling exactly(this can be a stupid question, but still I want some ideas as I am confused with exception handling).
Thanks in Advance.