From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10593 invoked by alias); 10 Mar 2008 23:42:55 -0000 Received: (qmail 10585 invoked by uid 22791); 10 Mar 2008 23:42:55 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.179) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 10 Mar 2008 23:42:38 +0000 Received: by wa-out-1112.google.com with SMTP id m16so2093070waf.20 for ; Mon, 10 Mar 2008 16:42:36 -0700 (PDT) Received: by 10.114.57.1 with SMTP id f1mr3998747waa.78.1205192556162; Mon, 10 Mar 2008 16:42:36 -0700 (PDT) Received: by 10.114.47.2 with HTTP; Mon, 10 Mar 2008 16:42:36 -0700 (PDT) Message-ID: Date: Mon, 10 Mar 2008 23:42:00 -0000 From: me22 To: "Jason Mancini" Subject: Re: int() always zero? Cc: gcc-help@gcc.gnu.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00090.txt.bz2 On Mon, Mar 10, 2008 at 7:38 PM, Jason Mancini 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(0), which may or may not be == reinterpret_cast(0)