by_ref_simple (ADVANCED!)

Takeaway

  • When using func1, where the values are forwarded “by value” or so-called copies of the original, ┬áthe values in the main() function don’t change even after modifying them in the subfunction.
  • When using func2, where variables are given “by reference” or as pointers to the originals (memory addresses), then the originals will be changed (& asks for the address, * points to the variable using the address)