previous | start | next

Array: Add to Front

To add the value 3 to the front of the array arr (assuming arr is big enough):

arr[0] 5
arr[1] 10
arr[2] 15
arr[3] ?

We would need to move the existing 3 values:

arr[0] 3
arr[1] 5
arr[2] 10
arr[3] 15


previous | start | next