public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* why there is no memlen();
@ 2002-10-30  6:11 Arunachalam G
  0 siblings, 0 replies; 5+ messages in thread
From: Arunachalam G @ 2002-10-30  6:11 UTC (permalink / raw)
  To: gcc-help

Hi all,

is there any way to get the amount of memory allocated to a
pointer.

    ...
    char *m;

    m = (char *)malloc(sizeof(char) * 120);
    strcpy(m, "y no memlen");
    ...

in the above code strlen(m) will give  11. Is there any way to get the
amount of memory allocated to it, so that it should give 120.
and why there is no memlen() function in libc. any reason for this?

thanks
arun.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-31 13:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.44.0210301913410.29570-100000@anubhav.lan.deepr oot.co.in>
2002-10-30  6:29 ` why there is no memlen(); Eljay Love-Jensen
2002-10-31  2:52   ` Arunachalam G
2002-10-31  5:02     ` John Love-Jensen
2002-10-31  5:15       ` Buddy Lott
2002-10-30  6:11 Arunachalam G

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).