This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
why there is no memlen();
- From: Arunachalam G <arunachalam at deeproot dot co dot in>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 30 Oct 2002 19:35:07 +0530 (IST)
- Subject: why there is no memlen();
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.