“PID suatu proses di C” Kode Jawaban

PID suatu proses di C

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int pid = 0;
    printf("before the fork \n");
    pid = fork(); //create the child process
    printf("after the fork \n");
    if (pid == 0)
    {
        printf("I'm the child process, my pid is &d\n", getpid());
        exit(1);
    }
    else
    {
        printf("I'm the parent process, my pid is &d\n", getpid());
        exit(0);
    }
}
The Bad Programmer

PID suatu proses di C

# include<stdio.h>

#include <stdlib.h>

int main()

{

    int pid = 0;

    printf("before the fork \n");

    pid = fork(); //create the child process

    printf("after the fork \n");

    if (pid == 0)

    {

        printf("I'm the child process, my pid is &d\n", getpid());

        exit(1);

    }

    else

    {

        printf("I'm the parent process, my pid is &d\n", getpid());

        exit(0);

    }

}
shamain anjum

Jawaban yang mirip dengan “PID suatu proses di C”

Pertanyaan yang mirip dengan “PID suatu proses di C”

Lebih banyak jawaban terkait untuk “PID suatu proses di C” di C

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya