In Java, if a specific line of code causes the program to crash, then the exception is caught and the program continues to execute.
However, in C++, if I have a piece of
Not all crashes are due to unhandled exceptions. For your example, the C++ standard says that dereferencing the NULL pointer results in undefined behaviour. In Windows, you can handle problems that crash your program without throwing a C++ exception with structured exception handling (SEH): __try/__except/__finally. In Unix, you can set up special signal handlers.
Also, there is an error in your code. The exception handler for const char * would only be invoked when an exception of this type is thrown. For standard exceptions, you should catch std::exception or it's appropriate subclasses. To catch any C++ exception, use catch (...).