Contact: aviboots(AT)netvision.net.il
39,859 questions
51,780 answers
573 users
#include <stdio.h> #include <unistd.h> int main() { int id = fork(); printf("%d\n", id); printf("c programming\n"); return 0; } /* run: 20 c programming 0 c programming */
#include <stdio.h> #include <unistd.h> int main() { int id = fork(); printf("%d\n", id); if (id != 0) { fork(); } printf("c programming\n"); return 0; } /* run: 0 c programming 20 c programming 20 c programming */