Date: Thu, 5 Feb 1998 12:00:42 +0200 (IST) From: Eli Zaretskii To: David Shirley cc: djgpp AT delorie DOT com Subject: Re: Sizeof and pointers In-Reply-To: <34D8C88E.2849A0A@cs.curtin.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 5 Feb 1998, David Shirley wrote: > void func(unsigned char *tmp) > { > // BLAH BLAH > } > > How do i find how many bytes tmp is taking up in memory: In general, you can't. If you need to know the size of a function, you will need to write it in assembly. There's no C facility that you can trust to get this functionality. There is a hack you can use whereby you define two dummy functions, before and after the one whose size you need to know, and then subtract the addresses to compute the size. But that is not guaranteed to work, although it does in GCC 2.7.2.1.