Values & References1 / 16
Up next

References are aliases

#include <print>

int main() {
    int owned = 10;
    // ref is a second name for the same storage
    int& ref = owned;
    ref += 5;
    std::println("{}", owned);
}
What you're solving

a reference is another name, not a copy