Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have read Incase of insufficient memory new operator throws exception.
So my question is here....
Should we always creat an object inside try .....catch block?

if not then how can prevent to crash in this case?
Posted

1 solution

Your application should have exception handling to make sure that it does crash nicely. You should have at least a try catch block on a very high level, but a try catch for every "new" is far too much in my opinion.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900