Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 month agovoid *sh.itjust.worksimagemessage-square5fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imagevoid *sh.itjust.worksSjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 month agomessage-square5fedilink
minus-squarerhpp@programming.devlinkfedilinkarrow-up0·1 month agoActually void* just points to anything, with no regard to the type of that thing. Pointing to the void is more accurately described by NULL pointer.
minus-squaremox@lemmy.sdf.orglinkfedilinkarrow-up0·1 month agoIn other words, void refers to the typing of the pointer, not a particular value that might be present at its target. (But I can see how someone might find it confusing.)
minus-squaretunetardis@lemmy.calinkfedilinkarrow-up0·1 month agoFair, though I guess my interpretation was that void* is kind of like a black hole in that anything can fall into it in an unsettling way that loses information about what it was?
Actually
void*
just points to anything, with no regard to the type of that thing. Pointing to the void is more accurately described byNULL
pointer.In other words,
void
refers to the typing of the pointer, not a particular value that might be present at its target.(But I can see how someone might find it confusing.)
Fair, though I guess my interpretation was that
void*
is kind of like a black hole in that anything can fall into it in an unsettling way that loses information about what it was?