1
edit
Changes
→C/C++ FAQ
----
<br>
'''Q:''' When using square-bracket pointer notationarithmetic, does ptr[-k] decrement the pointer?<br>'''A:''' Yes. Detailed answer forthcoming'ptr' is the address of an element of the array; the array's element size is multiplied by the value of 'k', negated by '-', and then 'added' (in practice subtracted) to the address stored in 'ptr'. ptr[-k] moves k elements earlier than the element pointed to by ptr.<br><br>