1
edit
Changes
no edit summary
<br>
'''Q:''' When using square-bracket pointer arithmetic, does ptr[-k] decrement the pointer?<br>
'''A:''' Yes. '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' to the address stored in 'ptr'. ptr[-k] moves to the element 'k' elements earlier than the element pointed to by ptr.