From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,2b585bfb397fe81e X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-08-08 07:00:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!news.compaq.com!news.cpqcorp.net!53ab2750!not-for-mail From: "Ed Vogel" Newsgroups: comp.unix.tru64 References: <6_sYa.1689$K_4.849@news.cpqcorp.net> Subject: Re: how to determine the size of dynamic array?? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-mimeole: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Fri, 08 Aug 2003 14:00:50 GMT NNTP-Posting-Host: 16.28.64.73 X-Complaints-To: abuse@HP.com X-Trace: news.cpqcorp.net 1060351250 16.28.64.73 (Fri, 08 Aug 2003 07:00:50 PDT) NNTP-Posting-Date: Fri, 08 Aug 2003 07:00:50 PDT Organization: Hewlett-Packard Company Xref: archiver1.google.com comp.unix.tru64:10567 "Tylenol" wrote in message news:becbc481.0308071256.2534600a@posting.google.com... | Thanks Ed Vogel, | For dynamic array, the block of memory is allocated by "malloc()" such | as | | int *a = malloc(16); | In this case you don't really have a varible-length array, you simply have dynamic storage that you chose to reference as an array. | When I use sizeof(a), it gives me 8 not 4. Anything wrong?? or I use | the "sizeof()" function in wrong way. When you say sizeof(a), this will give you the size of a, which is a pointer. A pointer on Tru64 is 8 bytes. I do not know of a way to find the size of the malloc'ed storage. Ed