mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-10-28 11:10:38 +01:00
rzeczy
This commit is contained in:
10
uczelnia/2_semestr/programowanie/laby/lab5/zad1.cpp
Normal file
10
uczelnia/2_semestr/programowanie/laby/lab5/zad1.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
// Prześledź krok po kroku poniższy kod. Dla każdej linii zanotuj wartość ptr, *ptr
|
||||
// (jeśli dostępna) oraz czy pamięć jest zaalokowana.
|
||||
|
||||
int *ptr = nullptr;
|
||||
ptr = new int(5);
|
||||
std::cout << *ptr << '\n';
|
||||
*ptr = *ptr + 3;
|
||||
std::cout << *ptr << '\n';
|
||||
delete ptr;
|
||||
ptr = nullptr;
|
||||
Reference in New Issue
Block a user