Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Link Between Pointer and Variable | Pointers Fundamentals
C++ Pointers and References

Swipe to show menu

book
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 start coding

  1. Declare and initialize the pointer with a variable address.
  2. Change the value of dereferenced pointer to zero.
  3. Output the variable value.

Solution

cpp

solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 3

Ask AI

expand
ChatGPT

Ask anything or try one of the suggested questions to begin our chat

book
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 start coding

  1. Declare and initialize the pointer with a variable address.
  2. Change the value of dereferenced pointer to zero.
  3. Output the variable value.

Solution

cpp

solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 3
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt