News for hackers. Stuff that matters.
Re:C++17 creates a practical use of the backward array index... by omoikane on Monday April 03, 2023 @04:32PM (#35430863)
Backward array index always had a use in the code golf context, like this:

    int a[3] = {0, 1, 2};
    int *p = a;
    int **q = &p;

    int x = (*q)[1];  // Read a[1]
    int y = 1[*q];    // Same, but saves 2 bytes
Code golf considerations aren't always related to practicality, of course.
Re:C++17 creates a practical use of the backward array index... by zeusk on Monday April 03, 2023 @05:56PM (#35431866)
If saving bytes is the goal, why not

> int a[]={0,1,2};

> int y = a[1];

Re:C++17 creates a practical use of the backward array index... by pritambaral on Monday April 03, 2023 @06:49PM (#35432447)
It's a demonstration, not real code. The first block of code is prologue, not main body.