Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: "Ed Vogel" <edward.vogel_nospam@hp.com>
Subject: Re: how to determine the size of dynamic array??
Date: Thu, 07 Aug 2003 14:02:42 GMT	[thread overview]
Message-ID: <6_sYa.1689$K_4.849@news.cpqcorp.net> (raw)
In-Reply-To: becbc481.0308061530.22556518@posting.google.com


    If by "dynamic array" you mean what the C Standard calls
    "variable length array",  the C compiler on Tru64 has this
    support, and you just use the sizeof() operator to get the
    size of the array.  For example:

    int x = 5;
    main() {
        int a[x];   /* Declare a varible length array */
        printf("size is %d\n",sizeof(a));
    }

    will emit: "size is 20" when run.

    Ed Vogel
    HP C Engineering

"Tylenol" <harley_chan@hotmail.com> wrote in message
news:becbc481.0308061530.22556518@posting.google.com...
| Hi All:
| Does anyone have ideas how to determine the size of dynamic array? I
| know MSVC have a function called "_msize()" which doing this kind of
| job. However, I am not sure on Unix Tru64 have a similar function or
| not. The most similar function I found is "mallocate()" but this
| function returns the array size is always larger than original
| requested size of array. Any function in Unix Tru64 doing the same job
| as "_msize()"? Please Help!!!
|
| Thanks in advance
| Harley




  reply	other threads:[~2003-08-07 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06 23:30 how to determine the size of dynamic array?? Tylenol
2003-08-07 14:02 ` Ed Vogel [this message]
2003-08-07 20:56   ` Tylenol
2003-08-08 14:00     ` Ed Vogel
2003-08-20 17:59       ` Jerry Feldman
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox