Pass by Reference

Phrase · Development

Definitions

  1. A parameter-passing convention in which a function receives a reference (pointer or alias) to the caller's original variable, so modifications inside the function directly affect the original value. C++ supports this explicitly with & references.

    In plain English: Giving a function direct access to the original variable, so any changes the function makes are reflected outside the function too.

    Example: "That function takes the vector by reference, so it sorts the original in place instead of returning a sorted copy."

Related Terms