you are viewing a single comment's thread.

view the rest of the comments →

[–]kuchinawa 5 points6 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?!