Array help

I have no idea how to do this, Write a function to count the number of time that the number 100 appears in an array. the function must be general purpose and receive an array of integers of any size. The function should receive two parameters: the array and the number of elements in the array. The function should return the count of the number of time the number 100 appears in the array.
Declare an int called "numOccurences".

iterate over your array:
http://stackoverflow.com/questions/1597830/iterate-through-a-c-array

check each element. if it's 100, increment your numOccurences variable.
first do it in main() function.

simpler task:
suppose,
int arr[] = {1,4,6,9,0,2,53};
int n;
cin >> n;

now can you check if n is in the array?
I understand up to the point of what is what in my function
if i set it up as
int fun(int secondArray[200], int num)




call = fun(secondArray, 200)

which one of these will be counting through the numbers? I thought that second Array[200] would but it looks like it would just get the last value.
Topic archived. No new replies allowed.