Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

fork in c

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main() {
  
    // make two process which run same
    // program after this instruction
    fork();
  	
    // this will print hello world twice
    printf("Hello world!
"); 
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #fork
ADD COMMENT
Topic
Name
8+3 =