> 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.
The explicit cast is not needed in C.
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++.