Sjmarf to Programmer [email protected] • 6 months agovoid *sh.itjust.worksimagemessage-square13fedilinkarrow-up1641arrow-down110
arrow-up1631arrow-down1imagevoid *sh.itjust.worksSjmarf to Programmer [email protected] • 6 months agomessage-square13fedilink
minus-square@[email protected]linkfedilink7•6 months agoSo, when I want the void to point back at me, do I have to loop over void* or over NULL? And how many iterations?
minus-squareProgrammer BelchlinkfedilinkEnglish7•6 months agoFor the void to point back at you just dereference the NULL pointer
minus-square@[email protected]linkfedilink3•edit-26 months agoas many iterations as it takes void* x = &x; char* ptr = (char*)&x; while (1) { printf("%d\n", (unsigned int)*ptr); ptr--; }
So, when I want the void to point back at me, do I have to loop over void* or over NULL?
And how many iterations?
For the void to point back at you just dereference the NULL pointer
as many iterations as it takes
void* x = &x; char* ptr = (char*)&x; while (1) { printf("%d\n", (unsigned int)*ptr); ptr--; }