Course Content
C++ Pointers and References
C++ Pointers and References
3. References Fundamentals
Link Between Pointer and Variable
When you modify the value through the dereferenced pointer, you are essentially modifying the content of the memory location it points to. This directly affects the original variable.
Remember
Changing the value through *(p_variable) is equivalent to changing the value of variable.
Task
Swipe to show code editor
- Declare and initialize the pointer with a variable address.
- Change the value of dereferenced pointer to zero.
- Output the variable value.
Solution
solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 3
Link Between Pointer and Variable
When you modify the value through the dereferenced pointer, you are essentially modifying the content of the memory location it points to. This directly affects the original variable.
Remember
Changing the value through *(p_variable) is equivalent to changing the value of variable.
Task
Swipe to show code editor
- Declare and initialize the pointer with a variable address.
- Change the value of dereferenced pointer to zero.
- Output the variable value.
Solution
solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 3
Switch to desktop for real-world practiceContinue from where you are using one of the options below