Define the template function
template <typename T1, typename T2>
int count_range(T1 a[], T2 size, T1 low, T1 high)
that returns the number of times a value between low and high (inclusive) occurs in a. For instance, count_range(arr, 6, 2, 4) would return 4. Test your function in your main(). Write a comment explaining which operations the types T1 and T2 need to support for your code to work. Test the function in main using an array of ints, and an array of strings.
Solved 1 Answer
See More Answers for FREE
Enhance your learning with StudyX
Receive support from our dedicated community users and experts
See up to 20 answers per week for free
Experience reliable customer service
template <typename T1, typename T2> int count_range(T1 a[], T2 size, T1 low, T1 high){     int count=0;     for(int i=0;i<size;i++){         if(a[i]>=low && a[i]<=high)             count++;     }     return count; }   Note : Please comment below if you have concerns. I am here to help you   If you like my answer please rate and help me it is very Imp for me ...