The C++ language handles implicit conversion of primitive data types.
If you write an expression with an int where the compiler expects a long, the compiler knows how to make the conversion and does so.