Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #ifdef SEGFAULT
- char * const s = "str";
- #endif
- void segfault(char **p)
- {
- *p = "hello";
- }
- int main(void)
- {
- #ifndef SEGFAULT
- char * const s = "str";
- #endif
- segfault((char **)&s);
- printf("%s\n", s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement