From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23634 invoked by alias); 20 Jul 2005 14:55:33 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 23555 invoked by uid 22791); 20 Jul 2005 14:55:20 -0000 Received: from exprod6og2.obsmtp.com (HELO psmtp.com) (64.18.1.122) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Wed, 20 Jul 2005 14:55:20 +0000 Received: from source ([192.150.20.142]) by exprod6ob2.obsmtp.com ([64.18.5.12]) with SMTP; Wed, 20 Jul 2005 07:55:17 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j6KF1NTK015136 for ; Wed, 20 Jul 2005 08:01:23 -0700 (PDT) Received: from iplan-mn (iplan-mn.corp.adobe.com [10.32.16.20]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j6KEtEn4010205 for ; Wed, 20 Jul 2005 07:55:14 -0700 (PDT) Received: from iplan-mn (localhost [127.0.0.1]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IJX001IPLG163@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Wed, 20 Jul 2005 09:55:14 -0500 (CDT) Received: from mn-eljay-a51m.adobe.com (mn-dhcp-17-28.corp.adobe.com [10.32.17.28]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IJX0011PLG1GX@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Wed, 20 Jul 2005 09:55:13 -0500 (CDT) Date: Wed, 20 Jul 2005 14:55:00 -0000 From: Eljay Love-Jensen Subject: Re: signed/unsigned char In-reply-to: <20050720144555.GA63554@registro.br> To: Milena Constantino Caires , gcc-help@gcc.gnu.org Message-id: <6.2.1.2.2.20050720095738.0243f5b0@iplan-mn.corp.adobe.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <20050720144555.GA63554@registro.br> X-SW-Source: 2005-07/txt/msg00201.txt.bz2 Hi Milena, > char* c = new char(1024); This allocates a single character, initialized with the value 1024. (Since 1024 is bigger than what a char can hold on most systems, it will get sliced.) >I know that the correct form of this memory allocation is "[1024]" and not "(1024)" but sometimes it occurs by mistake. Both forms are correct. You can allocate an array of char. You can allocate a single char. >The compiler is not supposed to complain about it??? No, there is nothing to complain about. You are allowed to allocate a single object. HTH, --Eljay