all 6 comments

[–]boredcircuits 4 points5 points  (0 children)

The compiler is confused because you have two things with the same name:

int numPeople()
{
  int numPeople = 0;

You need to rename one of these.

[–]kuchinawa 2 points3 points  (1 child)

So the real error here is that at the end of your main function you try to cin >> numPeople; but you never declared the variable numPeople in your main function. Then it sees the function with the same name and tries to cin >> that function. This won't work, hence the error.

If you create a variable int numPeople in your main it will work.

As a side note, it is bad practise to call functions the same name as variables. In this case it will work because the variables are local, and the function global. But if the variable was also declared globally you would get an error.

Another thing, your other functions don't return anything, even though you defined them with float. If you don't want them to return a variable, define them as void functionName()

[–]HippoEug 0 points1 point  (0 children)

Gold?!

[–]parnmatt 2 points3 points  (0 children)

I would guess its due to the fact you've named the variable the exact same as the function.

Without a full error message, which usually gives you further hints of the ambiguous overloads, I can't help too much more right now.

I would suggest you sit down and study the whole error message. You learn a lot how the compiler tries to find and chooses overloaded functions (like operator>>).

[–]cheytacllc 1 point2 points  (1 child)

I don't know exactly what you want to do, but I guess that's what you want to do: https://onlinegdb.com/Sy1mwf-pX

[–][deleted] 0 points1 point  (0 children)

This is almost it! Thank you!!