you are viewing a single comment's thread
view the rest of the comments
[–] 22 points 4 months ago (6 children)

Dynamically allocated multidimensional arrays.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 12 points 4 months ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 4 months ago (2 children)
  • [–] 3 points 4 months ago (1 child)

    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***.

  • source
  • parent
  • hideshow 1 child comment