Search code examples
language-agnosticpointerscoding-styleindirection

Have you come across any reason for three levels of indirection?


Just flicking through one of my favourite books (Ellen Ullman's The Bug) and there is a small bit where one programmer confronts another over three levels of indirection:

***object_array = ***winarray;

I get the idea of double indirection - a way of passing a pointer into a function, and allowing it to point to an object created within the function.

But have you come across any reason to use three (or more) levels of indirection?


Solution

  • Sure
    4 dimensional arrays.
    It doesn't take too much for an application for such an array either. Say some sort of lookup table. I've had lookup tables of 8 and more dimensions.