2 ms·
A pointer of type "void star" 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
by mhogomchungu 11y ago
A pointer of type "void star" 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 "void star".
First argument to realloc takes a pointer of type "void star" and you passed in a pointer of type "int star" without casting it and this suggests you did the casts out of habit and i think its time to break the habit :-)
ps:
had to write "void star" because the "star" character was not showing up for some reason.
- userbinator 11y agoshows lack of sufficient understanding of properties of pointers ...or shows someone more familiar with C++ than C. Implicit casts between pointer-to-void and other pointer types are not allowed in C++.