Parameter Qualifiers: ref, auto ref and inout

In this lesson, we will discuss three more parameter qualifiers: ref, auto ref and inout

We'll cover the following

ref #

This keyword allows passing a variable by reference even though it would normally be passed as a copy (i.e. by value).

For the reduceEnergy() function that we saw earlier, to modify the original variable, it must take its parameter as ref:

Get hands-on with 1200+ tech skills courses.