Question: Write a function which takes four formal parameters: 1) an array of int, 2) an int representing the length of the array, 3) a pointer
Write a function which takes four formal parameters: 1) an array of "int", 2) an "int" representing the length of the array, 3) a pointer to an "int", and 4) a pointer to an "int". This function will iterate over the array looking for the value the third parameter points to, and write the index of that value to where the fourth parameter points. If the value is not found in the array write "-1" to where the fourth parameter points.
Use the following function signature:
void findInArray(int numbers[], int length, int *numToFind, int *index)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
