Exception handling is the means by which exceptions -- anomalous events -- are resolved without causing a runtime error.
C++ compiler, obviously, a C compiler won't do.
Easy: there is no exception-handling in C.
Are mala cha pahije disadvantages.. ani tumhi mala vichartat.. ask to scientist....
Exception handling is largely the same for both. The only real difference is that C++ has no 'finally' clause which always executes whether an exception occurs or not. Another difference is that Java throws exceptions and errors, but errors cannot be handled since programs cannot handle errors -- such as the JVM out of memory error.
There is no such exception in C++. It's probably a 3rd party or user-defined exception. Examine the call-stack to determine where the exception was caught -- that should help you determine where the exception was thrown.
For file handling, use the input/output file stream objects, ifstream and ofstream, declared in the <fstream> header of the C++ standard library. Do not use C-style pointers unless you absolutely have to. The problem with "raw" resource pointers is that the resources are not automatically released when the pointers fall from scope. This has implications for exception handling strategies and exceptions are anything but exceptional, particularly where file handling is concerned. When an exception is thrown, every resource consumed between the exception handler and the exception itself must be released. The exception handler is ideally placed in a calling function that is best able to deal with the exception, thus the handler may not have access to the resources that were consumed up to the point the exception occurred. This means that every callee that consumes a resource must include its own localised exception handler which simply releases the resource and re-throws the exception. With resource handles (also known as smart pointers) we do not have this problem because resources are automatically released when the handle falls from scope. Thus our exception handling strategy becomes much more localised and our code becomes that much easier to maintain. And we get all this at no additional cost. Pointers may well give programmers a high-degree of control over resources, but that control has a cost in terms of maintainability and, in some cases, may actually result in reduced performance due to increased code size. Pointers certainly have their uses in C++, but resource management is not one of them. Always use resource handles unless you have good reason not to. In short, C-style resource pointers should only be used in C code, never in C++ code.
interrupt handling is the process of handling a break or interrupt called by a program where as exception handling is for handling some exceptional conditions that'll occur when a program is running
Exception handling is necessary for string handling as there might be some unexpected situation during string handling which may lead to program crash or abrupt termination
An exception is abnormal program flow, so handling the exception is the very definition of resolving the abnormality.
We use exception handling so that the program can gracefully handle any situation that may be unexpected. We use try-catch for exception handling. if-else is a conditional logic checking mechanism
Exception handling should be used in Java in all cases where you as a programmer suspect that your code might throw some exceptions or create errors that might look ugly when a user is using the application. In such cases you use exception handling to catch and handle the exception and exit gracefully. You use the try - catch block in Java for exception handling.
File handling is simply the process of opening, reading, writing and closing files. Files are simply streams for input and output, or the "serialisation" of objects. In other words, reading and writing data to and from disk storage.