R
relient
Hi, I have a question about malloc.
When I do this:
char **p = malloc(12);
does malloc implicitly do 12 * sizeof(char*) for me? or would I have to
explicitly do it?
If it does not implicitly do it, then what is returned?
- is it 3 pointers to work with since pointers take up 4 bytes each on
32-bit systems?
- or is it twelve pointers, which would mean malloc implicitly did 12 *
sizeof(char*), which equals: 48 bytes..?
Thanks in advanced,
relient.
When I do this:
char **p = malloc(12);
does malloc implicitly do 12 * sizeof(char*) for me? or would I have to
explicitly do it?
If it does not implicitly do it, then what is returned?
- is it 3 pointers to work with since pointers take up 4 bytes each on
32-bit systems?
- or is it twelve pointers, which would mean malloc implicitly did 12 *
sizeof(char*), which equals: 48 bytes..?
Thanks in advanced,
relient.