Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <cstring>
- #include <iostream>
- int main(int argc, char *argv[])
- {
- std::cout<<"This is the child process." <<" My pid is "<<getpid()<<" and my parent's id is "<<getppid()<<std::endl;
- for (int i = 0; i <argc; ++i) {
- std::cout<<argv[i]<<std::endl;
- sleep(2);
- }
- return 51;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement