Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Just?
Name one actual reason to have a fucking untyped 4d array in your webserver-code. -
olback109814y@metamourge uh, 4d array? Pointer to pointer is not necessarily an array. Looks like this points to the config somehow.
-
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. -
Someone that contains the dark magic knowledge of proper C development please explain this to me and explain the WHY
-
@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. -
@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! ^^
-
@AleCx04 I’ve never seen a use for that.. 2 yes, maybe a triple ive seen but like once ever.. 4 tho? Wtf lol
-
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.
Related Rants
Perhaps, its just a 4d array
joke/meme
devhumor
rant
c