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

bookIntroduction to References

Deslize para mostrar o 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

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 9

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Seção 1. Capítulo 9
some-alt