NULL pointer dereferencing is undefined behavior. In general, this will cause a processor trap and an OS level error. This can then be mapped to a signal, such as SIGSEGV , or to an access violation error, or it can interrupt your program or do something else.
On Windows, it maps to a "structured exception", which is another beast for C ++ exception. Depending on how you configured MSVC, you can catch this with catch(...) , but not always.
source share