From: David Shirley Newsgroups: comp.os.msdos.djgpp Subject: Sizeof and pointers Date: Thu, 05 Feb 1998 03:59:10 +0800 Organization: APANA Western Australia Lines: 26 Message-ID: <34D8C88E.2849A0A@cs.curtin.edu.au> NNTP-Posting-Host: dialup05.odyssey.apana.org.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, Ok heres my problem, void func(unsigned char *tmp) { // BLAH BLAH } How do i find how many bytes tmp is taking up in memory: the sizeof funtion returns 4 bytes, the reason being (i think) that it is finding out how many bytes the pointer takes up in memory. I dont want to use strlen(tmp) because the string may have a '\0' character. Can someone tell me how to find out how many bytes tmp takes up in memory, OR how to declare it so that sizeof(tmp) will return the correct number? thankz D.