Question: pls help Write a method void remove(int *a, int index) that will remove the number at the given index and shift all remaining numbers one
pls help
Write a method void remove(int *a, int index) that will remove the number at the given index and shift all remaining numbers one position to the left in the array a. Assume 1that the last element of the array is -1. Now, write a main function that will define an array int A[40]=[3, 5, 9, 17, 24, -1]; read from user input an index; and call the method remove passing array A and the index given by the user. For example if user enters 2, then number 9 at index 2 will be removed and the array will now contain [3, 5, 17, 24, -1] Print the array after the removal. You MUST write the remove method using ONLY pointers and pointer arithmetic (no array notation [ ] allowed).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
