Introduction to References
Sveip for å vise menyen
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 9
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Seksjon 1. Kapittel 9