William M. answered 12/15/19
Tutor
4.9
(99)
College Professor of C++ with 7+ years of teaching experience
This code should reliably crash.
#include <iostream>
#define BUFSIZE 10
int main(int argc, const char* argv[]) {
char buf[BUFSIZE];
buf[BUFSIZE + 1] = 'a'; // memory access error here
return 0; // it will never reach this line
}