Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Dereferencing | References & Pointers
Harjoittele
Projektit
Tietovisat & Haasteet
Visat
Haasteet
/
C++ Intermediate | Mobile-Friendly

bookDereferencing

Pyyhkäise näyttääksesi valikon

To operate with the variable, you can also access it by dereferencing the variable's pointer. For example, you can change the value of the variable by using pointers:

123456
int b = 1; int *pb = &b; *pb = *pb + 2; // b = 1 + 2 b = 3 + *pb; // b = 3 + 3 cout << b << endl;
copy

In all the statements above, we added numbers to the value of b and assigned the result to the variable b.

question-icon

Decrease x by 3 using pointers.

int x = 1;
int *px = &x;

*px =
;

Klikkaa tai vedä ja pudota esineitä ja täytä tyhjät kohdat

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 3

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Osio 2. Luku 3
some-alt