what's the difference between pid_t datatype and int when getting process id? I saw something like:
pid_t getpid(void);
but whats the difference between it and
int getpid(void);
Quoting from the libc manual:
The pid_t data type is a signed integer type which is capable of representing a process ID. In the GNU C Library, this is an int.
data types that ends with "_t", are usually a defined type variable in C and C++ as an unwritten law. according to that law, "pid_t" is a data type which is defined somewhere else but "int" a standard type; so to know the differences you need to know how "pid_t" is defined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With