get pid of a process in c code example
Example 1: how to get pid of c process
#include <sys/types.h>
#include <unistd.h>
pid_t getpid(void);
Example 2: c program to print pid of a process
Process ID: 1298
Parent Process ID: 879
#include <sys/types.h>
#include <unistd.h>
pid_t getpid(void);
Process ID: 1298
Parent Process ID: 879