Question: In C++, write a recursive function containsOnly that takes three parameters: an array, its size, and a target value. The array contains integers, and the
In C++, write a recursive function containsOnly that takes three parameters: an array, its size, and a target value. The array contains integers, and the target value is an integer. The function should return true if every value in the array is equal to the target value, otherwise it should return false. Note: your function should return true if the size is 0. Do not use loops, extra parameters, or global or static variables.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
