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

Stryg for at vise menuen

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.

Opgave

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.

Løsning

cpp

solution

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 3
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

Awesome!

Completion rate improved to 5.88

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.

Opgave

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.

Løsning

cpp

solution

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

close

Awesome!

Completion rate improved to 5.88

Stryg for at vise menuen

some-alt