Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Introduction to References | Section
C++ Pointers and References

bookIntroduction 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

reference.h

copy
12
int originalVariable = 42; int& referenceVariable = originalVariable;

So, when you use referenceVariable, you are actually working with originalVariable.

Advantages of Reference

question mark

What is false about the references?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 9

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Sezione 1. Capitolo 9
some-alt