3 ms·
You're correct, although I'm fairly sure dereferencing a `void*` is a compile error on all but the most ancient and non-conforming compilers. I'm not even sure
by tyg13 3y ago
You're correct, although I'm fairly sure dereferencing a `void*` is a compile error on all but the most ancient and non-conforming compilers. I'm not even sure what it _could_ compile to, given that `void` has no size.
- zer8k 3y agoYes most modern C compilers will stop you from dereferencing a void pointer. Still, I couldn't help but bring up what can happen. Since I didn't witness it I can only assume 3 mile island was someone dereferencing a void pointer and it was easier to explain with a nuclear meltdown.
- tedunangst 3y agovoid * was introduced after char * had been the pre-standard way of addressing any memory. Compilers of the era would let you use void * like char *, because it made it easier to change char * into void *.