I actually use negative indices in real code[1].<p>If you implement a stack using an array and you track the top of stack by a pointer just past the last element, then you can index negatively into that pointer to access items on the stack:<p><pre><code>    &#x2F;&#x2F; Create an empty stack.
    int stack[100];
    int* top = &amp;stack;

    &#x2F;&#x2F; Push a couple of values.
    *top++ = 123;
    *top++ = 456;

    &#x2F;&#x2F; Peek the values.
    printf(&quot;%d\n&quot;, top[-1]); &#x2F;&#x2F; 456.
    printf(&quot;%d\n&quot;, top[-2]); &#x2F;&#x2F; 123.
</code></pre>
You could make the pointer arithmetic more explicit like this:<p><pre><code>    printf(&quot;%d\n&quot;, *(top - 1)); &#x2F;&#x2F; 456.
</code></pre>
But I think that&#x27;s needlessly verbose.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;munificent&#x2F;wren&#x2F;blob&#x2F;master&#x2F;src&#x2F;vm&#x2F;wren_vm.c#L628" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;munificent&#x2F;wren&#x2F;blob&#x2F;master&#x2F;src&#x2F;vm&#x2F;wren_v...</a>