Good afternoon, please tell me how to display the PID of the process being started in a program written in C ++. OS - Linux

    1 answer 1

    I correctly understood that the process should withdraw its PID? If so, then:

    #include <sys/types.h> #include <unistd.h> #include <iostream> int main() { std::cout << getpid() << std::endl; return 0; } 
    • Yes, that's right, thank you - Yegor Sokolov