From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrei Bunghez Subject: Re: constant in C Date: Fri, 24 Sep 2004 10:16:32 +0300 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: References: <20040924033646.62233.qmail@web52901.mail.yahoo.com> Reply-To: Andrei Bunghez Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20040924033646.62233.qmail@web52901.mail.yahoo.com> List-Id: Content-Type: text/plain; charset="us-ascii" To: Ankit Jain Cc: linux prg Hi, Actually that 'const' has no size at all, it is not a variable, has no address. The preprocessor replaces const in the source code with 123456789, or whatever its definition is. For example: x = const + 3; will be preprocessed, and the compiler will see: x = 123456789 + 3; Therefore you cannot use sizeof(const), &const etc. Regards, Andrei On Fri, 24 Sep 2004 04:36:46 +0100 (BST), Ankit Jain wrote: > what is the size of the constant > > i.e #define const 123456789 > > thanks > > ankit > > ________________________________________________________________________ > Yahoo! Messenger - Communicate instantly..."Ping" > your friends today! Download Messenger Now > http://uk.messenger.yahoo.com/download/index.html > - > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >