550
Pointers explained: (lemmy.world)
top 50 comments
sorted by: hot top controversial new old
[-] refalo@programming.dev 4 points 6 days ago

that's not LaurieWired

[-] HeyThisIsntTheYMCA@lemmy.world 3 points 6 days ago

Uh I'm a charisma class (with unfortunate base stats) what's int

[-] zerofk@lemmy.zip 3 points 6 days ago

It’s what makes mages turn those squiggly lines on paper into fireballs.

Not clerics though, they’re different.

[-] Quibblekrust@thelemmy.club 4 points 6 days ago

Am I a computer scientist now?

[-] ZILtoid1991@lemmy.world 0 points 6 days ago

No, you need to learn a lot more. Other programming concepts, programming paradigms, algorithms, and many more.

[-] lime@feddit.nu 108 points 1 week ago

they used to call him the deref king back in college

[-] lian_drake@lemmy.world 73 points 1 week ago
[-] ZILtoid1991@lemmy.world 6 points 1 week ago

Null termination is no longer recommended, use fat pointers instead!

load more comments (9 replies)
[-] NullPointerException@lemmy.ca 66 points 1 week ago

Wait. It’s been a long time but shouldn’t be int*** -> int** -> int* -> int ?

[-] Susaga@sh.itjust.works 84 points 1 week ago

I think int*** is meant to be pointing at int**, but the image is just unclear about where everything is in perspective.

[-] dohpaz42@lemmy.world 28 points 1 week ago

Pretty sure the image is clear:

int*** -> int*
int** -> int
Int* -> int

Clarity doesn’t mean correct. But that’s probably why it’s posted here. 🤷‍♂️

[-] mexicancartel@lemmy.dbzer0.com 9 points 1 week ago

int** is inside a TV, and persumably int* must be inside another TV(even though uts not edited in). The image perespective is showing one thing inside the other, inside the other. So when when int*** points the TV it reference int**, which reference int* which reference int. Its just edited very bad

[-] Susaga@sh.itjust.works 8 points 1 week ago

RT*** isn't pointing at RT*, he's pointing at the TV showing RT**. The fact you think otherwise is what makes the image unclear. I'm not sure why you insist on them being wrong.

[-] _tasten_tiger@feddit.org 0 points 4 days ago

But that doesn't hold up, because RT** isn't pointing at a TV containing RT* only RT*** is pointing at an TV containing RT** RT* and RT

load more comments (6 replies)
[-] obviouspornalt@fedinsfw.app 15 points 1 week ago

I mean, that's pretty much what happens to me every time I try to use pointers, so the meme checks out.

[-] terranoid@lemmy.cafe 7 points 1 week ago

yep this is just someone misunderstanding pointers lol

load more comments (1 replies)
[-] DrCake@lemmy.world 41 points 1 week ago

Rumble Tumble Games in the wild

Seeing him break containment is wild

[-] MrNesser@lemmy.world 30 points 1 week ago

Didn't expect to see the Drift King here

[-] Jumi@lemmy.world 9 points 1 week ago* (last edited 6 days ago)

Drift King? You mean Dan the Villian

[-] dangrousperson@feddit.org 11 points 1 week ago

as a python script kiddie, this is way over my head, but upvoted because of RT Game

[-] MonkderVierte@lemmy.zip 8 points 1 week ago* (last edited 1 week ago)

So, googling it, the general premise is you should use smart pointers instead to avoid crashes. Got it.

[-] HeyThisIsntTheYMCA@lemmy.world 5 points 6 days ago

Uh

I think I'll just let the cat drive instead

[-] CanadaPlus@lemmy.sdf.org 4 points 6 days ago* (last edited 6 days ago)

They all have footguns that cause different crashes.

If you want to do explicit memory access without inevitable safety problems, you need Rust. That's the whole hype with Rust.

[-] MonkderVierte@lemmy.zip 1 points 6 days ago* (last edited 6 days ago)

But... per-process-isolation is a hardware feature, no?

[-] psud@aussie.zone 2 points 2 days ago

So you really should implement it in your compiler so you don't contravene it

[-] CanadaPlus@lemmy.sdf.org 2 points 5 days ago* (last edited 5 days ago)

Sure, that may be (it's definitely not in userspace). But don't forget it works by crashing your program.

[-] DahGangalang@infosec.pub 10 points 1 week ago

Smart pointers implies C++, which is not the right answer.

[-] MonkderVierte@lemmy.zip 6 points 1 week ago

Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written C++ book. It is way too big and complex for doing this. In fact, it is so big and complex, that there are very many very bad C++ books out there. And we are not talking about bad style, but things like sporting glaringly obvious factual errors and promoting abysmally bad programming styles.

https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

load more comments (1 replies)
[-] 14th_cylon@lemmy.zip 8 points 1 week ago

Why should the left one in the rectangle be int**? It doesn't make sense to me, they are both clearly just int*

What am i missing?

[-] ImgurRefugee114@reddthat.com 9 points 1 week ago

I they're supposed to be pointing at each other but the edit didn't really work because his arm is pointing too far away

load more comments (1 replies)
[-] Technus@lemmy.zip 7 points 1 week ago

Real talk: is there any practical use-case for T*** of any pointee type?

[-] palordrolap@fedia.io 22 points 1 week ago

Dynamically allocated multidimensional arrays.

[-] Technus@lemmy.zip 12 points 1 week ago

Ah right, so that would be a 3D array.

  • T* is a single row of T
  • T** is a list of rows
  • T*** is a list of "layers" in the third dimension

This would be incredibly hazardous to pass around as a bare pointer with no context, though. I'd expect to see this in a struct that, at minimum, also includes fields for the size of each dimension.

[-] BartyDeCanter@piefed.social 8 points 1 week ago

This ~~Sparta~~ C. We live for danger.

[-] Auth@lemmy.world 8 points 1 week ago

Tesseract Array

load more comments (3 replies)
load more comments
view more: next ›
this post was submitted on 08 Jun 2026
550 points (94.4% liked)

Programmer Humor

31835 readers
1110 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS