Created
May 2, 2026 06:40
-
-
Save thinkphp/fdf9542b26c689c2b0b7b7026a0a1af4 to your computer and use it in GitHub Desktop.
fork() process IF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include<unistd.h> | |
| using namespace std; | |
| int main(int argc, char const *argv[]) | |
| { | |
| if( fork() ) { | |
| cout<<"Hello "; | |
| } else { | |
| cout<<"World"; | |
| } | |
| return 0; | |
| //parent ---> child | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment