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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!