Because for some reason your calling the same function from within itself creating an infinite loop.
double calwadges() {
double total = 0;
for (int i = 0; i < getNumhours(); i ++) {
total += hours[i];
}
return calwadges();
}
The stack is basically a list of all the functions you've come through to get the current point in the code, so your stack might at some point be something like:
main() -> myfunction() -> myotherfunction()
There is only a limited amount of space available to store this 'list' so when you have infinite recursion (a function calling itself forever) then you eventually run out of space to store that function call which is your stack overflow error.
This is a very simplified explanation so if your interested you should do a quick search on how the stack works and what its purpose is.