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

Sveip for å vise menyen

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.

Oppgave

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 desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 3
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

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.

Oppgave

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 desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

close

Awesome!

Completion rate improved to 5.88

Sveip for å vise menyen

some-alt