Introduction to References
Scorri per mostrare il menu
A reference is simply another name for an existing variable. Instead of creating a new variable with its own memory, a reference points to the same memory location as the original variable. This means both names work with the same value.
reference.h
12int originalVariable = 42; int& referenceVariable = originalVariable;
So, when you use referenceVariable, you are actually working with originalVariable.
Advantages of Reference
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 9
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Sezione 1. Capitolo 9