Hello again everyone!
So I am stuck. I want to write a recursion that pulls information from an Array. This array only has 10 elements to it. I want to print out how many times each number appears in the array using recursion.
This is what I have so far. I just need a nudge in the right direction really I feel kinda lost.
1 2 3 4 5
int howmany(int a[], int length, int target)
{
if (target == 0)return 0;
else ()
}
So what you are saying is that I don't need to be moving target. What I need to be doing is moving length through the array and having target output what number or for that matter how many times that number appears in the array.
So instead of:
elsereturn howmany (a,length,target+1);
I am looking to move length through so:
elsereturn howmany(a,target,length+1) /* or minus one respectfully*/