News for hackers. Stuff that matters.
Re:The 5-minute Guide to C Pointers by mauchter on Thursday August 16, 2012 @12:40AM (#4389932)
> On lines 15-16 we assign our void pointer back to our castptr int pointer. Notice the explicit cast needed.

The explicit cast is not needed in C.

Re:The 5-minute Guide to C Pointers by RegEx on Thursday August 16, 2012 @02:34AM (#4390174)
Correct. This is also why you do not need to cast the result of malloc(). An assignment of a pointer to void to another pointer initiates an implicit conversion.
Re:The 5-minute Guide to C Pointers by eswangren on Thursday August 16, 2012 @04:24PM (#4393476)
And it is actually somewhat dangerous to cast the return value of malloc. Aside from being redundant it can hide an error on compilers which implement an older version of the standard (not uncommon. Anything pre-C99).

If you forget to include stdlib.h the cast hides the error and malloc will be assume to be a function which returns int. makes for interesting runtime errors.

Never cast the return value of malloc in C, and don't write redundant code. C is not C++.