adspace
What if memory allocation using new fails in C++ how to handle
Answer Posted / Abhay Mishra
"When memory allocation using 'new' fails in C++, it throws a 'bad_alloc' exception. To handle this exception, you can use try-catch blocks as follows:n1. Enclose the code that allocates memory inside a 'try' block.n2. Define a 'catch(bad_alloc)' block to catch the exception.n3. Write your error handling code inside the catch block."n
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
What do you mean by an interface in java?
What is the difference between break and continue statements?
What is the difference between filters and interceptors ?
Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com
What is the difference between equals() and == in java?
What is a constructor overloading in java?
Is minecraft 1.15 out?
How is declarative handling of exceptions done in struts ?
Write a program to print count of empty strings in java 8?
Find Best Job Vacancies across the world on Jooble!
What is difference between @controller and @restcontroller in spring?
What is latest hibernate version?
What is a classloader in java?
What is lazy class?