- The compiler needs the dara type to make sure that the pointer is not going to be used on illegal non-pointable types such as functions, labels, pointers, and reference.
- void * does not work for any type. The language does not allow assigning anything other than void to a pointer to void *.
- The compiler needs the data type to know how much memory to allocate for the pointer, because different data types require different pointer lengths.
- Yes, it causes a compiler error because one field is defined as having a size of 0.
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.