You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
315 B
Markdown
22 lines
315 B
Markdown
10 years ago
|
# This will just crash
|
||
|
|
||
|
```bash
|
||
|
$ gcc -xc - <<APP
|
||
10 years ago
|
```
|
||
|
```c
|
||
10 years ago
|
#include <stdio.h>
|
||
|
int main() {
|
||
|
int *p = NULL;
|
||
|
printf("Before pointer dereference\n");
|
||
|
*p = 1;
|
||
|
printf("After pointer dereference\n");
|
||
|
return 0;
|
||
|
}
|
||
10 years ago
|
```
|
||
|
```bash
|
||
10 years ago
|
APP
|
||
|
$ ./a.out
|
||
|
Before pointer dereference
|
||
|
Segmentation fault (core dumped)
|
||
|
```
|