Re: sizeof() return type ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Darryl Miles <darryl-mailinglists@xxxxxxxxxxxx> writes:

> This one is taxing me, what is the correct type returned by the built
> in sizeof() operator ?
> 
> int ?
> unsigned int ?
> size_t ?
> ssize_t ?

This is a general C question, not a gcc question.  As such, it should
probably go to a mailing list about C, not to a mailing list
specifically about gcc.  Thanks.

The answer is that sizeof returns a value of type size_t.

> Where does size_t and ssize_t originate from ?  ANSI/stdio ?

I believe size_t was introduced in the ISO C90 standard.  I believe
that ssize_t was introduced in the second edition of the POSIX 1003.1
standard (1003.1-1996).

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux