#include #include int main() { int* p1 = (int*) 5; printf("%d\n", *p1); // segfault char* p2 = NULL; printf("%c\n", *p2); // segfault char* p3 = (char*) malloc(sizeof(char) * 8); p3[0] = 0xFF; p3[1] = 0xFF; p3[2] = 0xFF; p3[3] = 0xFF; p3[4] = 0xFF; p3[5] = 0x0; p3[6] = 0x0; p3[7] = 0x80; p3[12345] = 0xFF; // possible (not guaranteed) segfault char* test = "Hello World!"; *test = 'X'; // bus error return 0; }