Hi,
In socket programming, why do we have a variable type pid_t to represent process id ?? I found its size being the same that of integer...I am confused..cannot we use int instead to denote process id ??
Hi,
In socket programming, why do we have a variable type pid_t to represent process id ?? I found its size being the same that of integer...I am confused..cannot we use int instead to denote process id ??
A lot of things all have the same size as int, but that's no reason to make them all ints.
Besides, there's no reason to suppose that everyone else has a pid_t the same size as an int.
So using a pid_t for things which expect a pid_t ensures your code will remain portable.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i got confused and asked this question as in
http://www.symbian.com/developer/tec..._tTypedef.html
i found pid_t to be defined the same type as that like int....that is why i got confused,