Re: pid_t data type



On Mar 15, 10:59 pm, Lew Pitcher <lpitc...@xxxxxxxxxxxx> wrote:
Sanchit wrote:
pid_t is a data type defines in types.h
but is it realy necessary to use it.. I mean it is a signed integer
type only..

Perhaps. In any case, what /size/ (or type, if you will) of integer is it?
Is it a short int, an int, a long int, or a long long int?

then why should pid_t be used??

So that you don't /have/ to know what type of integer the implementation
uses for a pid value.

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------

So if i will use long.. and i am not concerned with memory
management.. will it be fine in every case.. are there any specific
case where we should use only pid_t and not long (any any int type)
.



Relevant Pages

  • Re: integer types
    ... > bytes of memory. ... int is different sizes on different platforms. ... here's an 8-Bit Signed Integer: ...
    (comp.lang.cpp)
  • warning: comparison is always true due to limited range of data type
    ... This expression is intended to evaluate true whenever x is a signed integer ... When I use int, long, or long long, either signed or unsigned, this compiles ... it is also without warning. ... or the conversion involved in that arithmetic, ...
    (comp.lang.c)
  • Re: 2.3 -> 2.4: long int too large to convert to int
    ... long int too large to convert to int ... How do I tell Python that 0xc0047a80 is an ... somehow cobble together some way of forcing an unsigned integer into a ... signed integer. ...
    (comp.lang.python)
  • Re: Calling malloc from Fortran
    ... There are some C compilers on 64 bit systems where long and unsigned long are 64 bits, but that would be unusual on a 32 bit machine, or compiler compiling for 32 bit code. ... once it gets back to Fortran it is a signed integer again. ...
    (comp.lang.fortran)
  • Re: About Unions question
    ... The return type of getchar is of course int. ... represents "an unsigned char converted to an int". ... "When an integer is demoted to a signed integer with smaller size, ...
    (comp.lang.c)