Re: int() always zero?

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

 



On Mon, Mar 10, 2008 at 7:38 PM, Jason Mancini <jayrusman@xxxxxxxxxxx> wrote:
>
>  Hi everyone,
>  Is "int()" always zero?
>  bool() is always false?
>  type*() is always NULL?
>  Why, and which spec...
>  Thanks!
>  Jason
>

Research "value initialization" in your standard, iirc, but the answers are

int() ==> 0
unsigned() ==> 0u
bool() ==> false
some_pointer_type() == static_cast<some_pointer_type>(0), which may or
may not be == reinterpret_cast<some_pointer_type>(0)

[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