1 2 3 4 5 6 7 8 9 10
#include <stdlib.h> #include <stdio.h> #include <ncurses.h> void mallocfail() { endwin(); fprintf(stderr, "Failed to allocate memory\n"); exit(1); }