What are you doing with void pointers Jow Forums?
What are you doing with void pointers Jow Forums?
Other urls found in this thread:
meh, i didn't know those were real. brb learning stuff
void *ptr = &ptr;
Does it explode?
I cast them
No. It works perfectly fine and is valid.
I hash them
everything
i stick my tongue in them and cuddle close :3
Doesn't the RHS evaluate first?
God I wish I was a void pointer
void* ptr is declared and put on stack
&ptr is some address on stack
after assignment ptr points to this address
godbolt.org
I can cast you into one
Passing them to a function and casting them
void *ptr = (void *) malloc(sizeof(void));
malloc returns a void pointer
doesn't compile everywhere
void is considered an incomplete type, sizeof can't be applied to incomplete types
Making macro soup.
this
i understand this is a joke, but i get a feeling that you unironically believe that you need to recast from malloc lmao
cute lesbians