For the C code below, compare the defintions of the int pointers a and b;
#include
#include
int main()
{
int *a=malloc(s
Is it better in any way to typecast the pointer of type void, returned by the malloc function?
Yes. It is clearer in meaning. It's the same reason I'd write
a = b + (c * d);
Now, I know the "()"s are not needed here, due to the rules of precedence of arithmetic operators, but they help me (and others) clearly see my intent.
$.02, etc. :)
-k