Reputation: 483
I want to test a bunch of "application crash dump generators" like good old Dr. Watson.
What is the easiest way to provoke an application crash over a unhandled exception in C/C++?
Upvotes: 5
Views: 416
Reputation: 726549
While technically dereferencing a NULL
pointer is simply an undefined behavior, not a guaranteed crash, in practice it would crash with nearly absolute certainty:
(*((int*)0))=0;
Upvotes: 7