Re: Allocation of memory for Array of Pointers
- From: "chandan" <chandan.com@xxxxxxxxx>
- Date: 27 Dec 2005 22:42:02 -0800
i wrote:
> Forgot to mention that u must typecast the calloc function as its
> return type is void * (however some compiler automatically return
> pointer type of the type_of_its_second_ argument.)
i am sorry for the silly abbreviations, i had used. Thanks, for the
advice.
Martin Ambuhl wrote:
>Pay no attention to chandon; he knows nothing.
I never told that i know everything. i am a beginner to C and, really,
i don't know anything, as such, about C. I got my first lesson and I am
eager to learn more.
Keith wrote:
>No. calloc() returns a result of type void*, but it's implicitly
>converted to the target pointer type. An explicit cast is unnecessary
>and can mask errors (such as forgetting the required "#include <stdlib.h>"
>or compiling C code with a C++ compiler).
In my case, i was trying to compile this code with a C++ compiler. But,
please, can you elaborate how it masks the error and how stdlib.h helps
in conversion of type void * to target pointer type? i mean, how it
determines the target pointer type, if i am using a C compiler.
.
- Follow-Ups:
- Re: Allocation of memory for Array of Pointers
- From: Martin Ambuhl
- Re: Allocation of memory for Array of Pointers
- From: Richard Heathfield
- Re: Allocation of memory for Array of Pointers
- References:
- Allocation of memory for Array of Pointers
- From: smartbeginner
- Re: Allocation of memory for Array of Pointers
- From: chandan
- Re: Allocation of memory for Array of Pointers
- From: chandan
- Re: Allocation of memory for Array of Pointers
- From: Chuck F.
- Re: Allocation of memory for Array of Pointers
- From: Charles Richmond
- Allocation of memory for Array of Pointers
- Prev by Date: Re: Working in Unix but not in windows
- Next by Date: Re: memory leak (definition?)
- Previous by thread: Re: Allocation of memory for Array of Pointers
- Next by thread: Re: Allocation of memory for Array of Pointers
- Index(es):
Relevant Pages
|
|