Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Introduction to References | References Fundamentals
C++ Pointers and References
course content

Зміст курсу

C++ Pointers and References

C++ Pointers and References

1. Pointers Fundamentals
2. Pointer Arithmetic
3. References Fundamentals
4. Dynamic Memory Allocation

book
Introduction to References

A reference is an alias, or an alternative name, for an existing variable. It provides a way to access the value of a variable indirectly through another name. They do not have a memory address of their own. Instead they refer to the memory address of the variable they are referencing.

h

reference

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

Now referenceVariable is an alias for originalVariable. The primary purpose of references is to simplify and make safe, more readable code and avoid unnecessary memory overhead.

Advantages of Reference

question mark

What is false about the references?

Виберіть правильну відповідь

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 1
We're sorry to hear that something went wrong. What happened?
some-alt