please look into this.
It showing the error
Mistakes
-
you should have to pass i as 0 from main like
alloccurences(arr, 0, n, key); -
cout<< alloccurences(arr, 0, n, key);
this is wrong because alloccurences is void function so it doesn’t return anything hence why cout ??
remove cout
all changes are done in below code
Modified Code
if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with
and don’t forgot to mark doubt as resolved