Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Pointer Arithmetic Practice | Pointer Arithmetic
C++ Pointers and References
course content

Kurssisisältö

C++ Pointers and References

C++ Pointers and References

1. Pointers Fundamentals
2. Pointer Arithmetic
3. References Fundamentals
4. Dynamic Memory Allocation

book
Pointer Arithmetic Practice

Tehtävä

Swipe to start coding

  1. Create a pointer that points to the first variable.
  2. Find the distance between memory locations of this two variables.
  3. Using the pointer arithmetic move the pointer to the location of the second variable.
  4. Modify the value of dereferenced pointer to 50 and output the second variable.

Ratkaisu

cpp

solution

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 2
toggle bottom row

book
Pointer Arithmetic Practice

Tehtävä

Swipe to start coding

  1. Create a pointer that points to the first variable.
  2. Find the distance between memory locations of this two variables.
  3. Using the pointer arithmetic move the pointer to the location of the second variable.
  4. Modify the value of dereferenced pointer to 50 and output the second variable.

Ratkaisu

cpp

solution

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 2
Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt