Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <stdio.h>
- int main() {
- char * foo = "Hello";
- printf("foo = %p\n", foo);
- int id = fork();
- if(id == 0) {
- /* child */
- printf("I'm the child (foo = %p)\n", foo);
- }
- else {
- printf("I'm the parent (foo = %p)\n", foo);
- foo = "Ahoy";
- printf("I'm the parent (foo = %p)\n", foo);
- wait(id);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement