550
Pointers explained: (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] 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

[-] MonkderVierte@lemmy.zip 1 points 1 week ago
[-] palordrolap@fedia.io 3 points 1 week ago

In the C programming language. Or do you mean which C project specifically? Because as Technus surmises in their response, it's usually a better idea to set up aliases (typedefs or heck, even #defines) so that you're offloading some of the mental strain keeping track of the layers, and that's likely to be what happens in production code.

But the underlying data type is still T***.

this post was submitted on 08 Jun 2026
550 points (94.4% liked)

Programmer Humor

31835 readers
563 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