public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* int() always zero?
@ 2008-03-10 23:38 Jason Mancini
  2008-03-10 23:42 ` me22
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Mancini @ 2008-03-10 23:38 UTC (permalink / raw)
  To: gcc-help


Hi everyone,
Is "int()" always zero?
bool() is always false?
type*() is always NULL?
Why, and which spec...
Thanks!
Jason

_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: int() always zero?
  2008-03-10 23:38 int() always zero? Jason Mancini
@ 2008-03-10 23:42 ` me22
  0 siblings, 0 replies; 2+ messages in thread
From: me22 @ 2008-03-10 23:42 UTC (permalink / raw)
  To: Jason Mancini; +Cc: gcc-help

On Mon, Mar 10, 2008 at 7:38 PM, Jason Mancini <jayrusman@hotmail.com> 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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-10 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-10 23:38 int() always zero? Jason Mancini
2008-03-10 23:42 ` me22

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).