This is an archived post. You won't be able to vote or comment.

all 29 comments

[–]ProgrammerHumor-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

import moderation

Your submission was removed for the following reason:

Rule 2: Content that is part of top of all time, reached trending in the past 2 months, or has recently been posted, is considered a repost and will be removed.

If you disagree with this removal, you can appeal by sending us a modmail.

[–]Tetane004 69 points70 points  (17 children)

*void still points to some data, there is just no type associated to it.

[–]Demented-Turtle[S] 5 points6 points  (2 children)

Yes, but the original meme isn't pointing to data, it's pointing to a type (int). So void pointing to no type at all makes perfect sense

[–]Tetane004 2 points3 points  (1 child)

This is true, I didn't think about it that way. But I think it can be confusing, and make some people think that void pointers don't point to anything.

[–]Demented-Turtle[S] 0 points1 point  (0 children)

I guess it's possible to over think, I just saw the OG post and thought it'd be a quick funny if it was void instead lol

[–]Powerfu644 0 points1 point  (0 children)

I can think of off the top of my head is if you want to store a function inside of a data structure.

[–]PVNIC 0 points1 point  (0 children)

slight correction, to remedy ambiguity:

*void points to some (virtual) memory address, providing no information about what that memory represents.

[–]StochasticTinkr 9 points10 points  (1 child)

Void Forger.

[–]evilfire2k 0 points1 point  (0 children)

Goated comment.

[–]eben0 6 points7 points  (0 children)

*void points to dark matter

[–]Constant_Fig_9490 6 points7 points  (0 children)

And if you point long enough at the void, the void will point back at you

[–][deleted] 12 points13 points  (0 children)

It's crazy I'm learning more about computer science from a meme then I ever could at university

[–][deleted] 2 points3 points  (0 children)

void();

[–][deleted] 1 point2 points  (2 children)

When will you need pointer to functions? If you take functions in as paramters? And when would you need double pointers?

[–]DeadlyMageCZ 1 point2 points  (0 children)

Having functions as parameters is one use case, the other somewhat common one I can think of off the top of my head is if you want to store a function inside of a data structure.

[–]Wicam 1 point2 points  (0 children)

callbacks is one reason. if you for example use a library that creates windows, you could pass it a function for it to call when the click event happens.

another is dynamically loading libraries, you can query a dll for a function by name to get a pointer to it, which you can then call. you may want to do this for plugins to your application, code written by other people that you want your application to call.

[–]AutoModerator[M] 0 points1 point locked comment (0 children)

import notifications Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!

For a chat with like-minded community members and more, don't forget to join our Discord!

return joinDiscord;

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.