I am learning from the book "Extreme C". This is a code snippet which shows that the structure pointers are using the same memory address.
The thing I wonder is why to use (void*) if I can use printf() without it like so:
Parameters which match the variadic position (the ...) in any function are not subject to any kind of implicit conversion when you call the function.
printf expects a void*, and you have to manually cast any such pointers because of the ...
That was not the point :)
the function *requires* the cast to a void * (I honestly did not know C cared about this! C++ is picky about types, I will defer to Salem on C's needs). If it requires it, you must do it. There is no 'good practice' here, just mechanics, in other words -- if you do not do what is required, it will not work.
Void * are unavoidable (and frequently, invisibly so) in the C I learned, but I have not kept up with the language changes. I recommend you use them only when you need to do so. There are a few (far less, but a few) places where you need them in C++ as well. Using them when you do not need to do so would not be best practice, for sure.