A pointer of type &quot;void star&quot; can be assigned to a pointer of any type and hence those casts are not necessary. Having them doesnt hurt,but they add clutter and shows lack of sufficient understanding of properties of pointers of type &quot;void star&quot;.<p>First argument to realloc takes a pointer of type &quot;void star&quot; and you passed in a pointer of type &quot;int star&quot; without casting it and this suggests you did the casts out of habit and i think its time to break the habit :-)<p>ps:
had to write &quot;void star&quot; because the &quot;star&quot; character was not showing up for some reason.