From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23128 invoked by alias); 8 Aug 2008 13:40:42 -0000 Received: (qmail 23115 invoked by uid 22791); 8 Aug 2008 13:40:41 -0000 X-Spam-Check-By: sourceware.org Received: from vms173003pub.verizon.net (HELO vms173003pub.verizon.net) (206.46.173.3) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Aug 2008 13:39:55 +0000 Received: from [10.10.1.168] ([209.190.166.162]) by vms173003.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K5A00FT6B9ZI8L9@vms173003.mailsrvcs.net> for gcc-help@gcc.gnu.org; Fri, 08 Aug 2008 08:39:37 -0500 (CDT) Date: Fri, 08 Aug 2008 15:01:00 -0000 From: John Fine Subject: Re: odd behavior with Character Arrays In-reply-to: To: Rohit Arul Raj Cc: Mateusz Loskot , gcc-help Message-id: <489C4C8F.4060804@verizon.net> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8BIT References: <489BEDB7.2020905@loskot.net> User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) 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-08/txt/msg00073.txt.bz2 Maybe this is already clear from the answer Jędrzej gave. But in case it isn't: Rohit Arul Raj wrote: > Does that mean, that if the size of the array is specified, it appends > '\0' and if it is not specified then it does not append '\0'? > Can you/anyone clarify this point? > > The '\0' are appended only because the specified size is larger than the number of initial values. If you don't specify a size, then the size is the number of initial values, not some amount larger than the number of initial values.