Course Content
C++ Pointers and References
C++ Pointers and References
3. References Fundamentals
Pointer Arithmetic Practice
Task
Swipe to show code editor
- Create a pointer that points to the first variable.
- Find the distance between memory locations of this two variables.
- Using the pointer arithmetic move the pointer to the location of the second variable.
- Modify the value of dereferenced pointer to
50
and output the second variable.
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 2. Chapter 2
Pointer Arithmetic Practice
Task
Swipe to show code editor
- Create a pointer that points to the first variable.
- Find the distance between memory locations of this two variables.
- Using the pointer arithmetic move the pointer to the location of the second variable.
- Modify the value of dereferenced pointer to
50
and output the second variable.
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 2. Chapter 2
Switch to desktop for real-world practiceContinue from where you are using one of the options below