Why am I getting a segmentation fault? What am I doing wrong?

  c++, recursion, segmentation-fault

Problem: A program to count the number of times a number repeats in an array using recursion.

What I’ve done: I’ve tried every way I know, I’ve gone with an output array for storing indices of the number, and just ++ to another number on finding a match to current number. Nothing seems to work, it’s one error or another (I’m a noob). I tried looking for solutions online, found solutions on 3-4 websites but had no clue what was going on.

Here’s the code:


Source: Windows Questions C++