26
gg45
9d

Perhaps, its just a 4d array

Comments
  • 6
    Just?
    Name one actual reason to have a fucking untyped 4d array in your webserver-code.
  • 7
    @metamourge uh, 4d array? Pointer to pointer is not necessarily an array. Looks like this points to the config somehow.
  • 3
    @olback
    Was referencing @gg45 additional text.
  • 2
    @metamourge didn't even see that, my bad
  • 1
    Eerily beautiful.
  • 0
    And that is why you should not write it in C if you can do it in another language (like Erlang for example).
    Opportunity makes the thief.
  • 1
    Someone that contains the dark magic knowledge of proper C development please explain this to me and explain the WHY
  • 1
    Oh, I bet @Fast-Nop will love this.
  • 8
    @Oktokolo Even in C code, this is rare crap.

    @AleCx04 A variable is clear, and a pointer to that variable also. Now if you give a pointer to a function, but the function may change the pointer (e.g. memory realloc for enlarging the buffer), then you hand over a pointer to your pointer, that's two stars. I've never needed more than that.

    Even if it's some nested structures that contain further pointers, you'd use typedefs to wrap the pointers. And then you'd dereference as far as possible in the caller, not in the callee.

    Four stars is usually complete madness, especially if that shit is untyped (void).

    @PrivateGER I'm loving it like McDonald's.
  • 1
    @Fast-Nop
    I know - but i try hard to never miss a chance to rant about C.
  • 2
    @Oktokolo Then we're like Sheridan's coffee liquor in that regard because I love C above any other language. The best portable macro assembler ever! ^^
  • 1
    @Fast-Nop
    I definitely agree with you regarding the macro assembler part...
  • 1
    @Fast-Nop your the best man! thanks for explaining that!
  • 3
    @AleCx04 I’ve never seen a use for that.. 2 yes, maybe a triple ive seen but like once ever.. 4 tho? Wtf lol
  • 1
    types.h:
    struct conf
    {
    void * ctx;
    ...
    };

    module.h:
    struct module_ctx
    {
    struct conf * conf;
    ...
    };

    module/submodule.h:
    struct submodule_ctx
    {
    struct module_ctx * parent_ctx;
    ...
    };

    polymorphicUtils.h:
    void **** conf_ctx = submodule_ctx_instance_pointer;

    Probably something like that happened.
  • 0
    i used them in my own memory management around 20 years ago
Add Comment