How to call on a function found on another file?

You can use header files. Good practice. You can create a file called player.h declare all functions that are need by other cpp files in that header file and include it when needed. player.h player.cpp main.cpp Not such a good practice but works for small projects. declare your function in main.cpp

What is the meaning of single and double underscore before an object name?

Single Underscore Names, in a class, with a leading underscore are simply to indicate to other programmers that the attribute or method is intended to be private. However, nothing special is done with the name itself. To quote PEP-8: _single_leading_underscore: weak “internal use” indicator. E.g. from M import * does not import objects whose name starts with an … Read more

C++ identifier is undefined

Reducing to three lines (the other errors are analogous): While wall is defined, gallons is not. And where do you want to get gallons from anyway? The result is hidden deep inside another function. How do you want to get it out from there? Well, you need a return value: This way, you can use your function like this: Analogously for … Read more