[Solved] How to find the PID of a C code during compilation time? [closed]

[ad_1]

Why not the getpid() method defined in unistd.h?

#include <unistd.h>
int main(){
    int pid = getpid();
    int parentsPID = getppid();
    return 0;
}

1

[ad_2]

solved How to find the PID of a C code during compilation time? [closed]