File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -877,12 +877,12 @@ int * ptr = nullptr; // ptr is a separate variable whose type is 'poi
877877printf ("ptr = %p\n"); // Prints: 0x0
878878
879879ptr = &a; // The value of ptr is now the address of the variable 'a'
880- std::cout << p << std::endl; // Prints: 0x2a000084
881- std::cout << * p << std::endl; // Prints: 10
880+ std::cout << ptr << std::endl; // Prints: 0x2a000084
881+ std::cout << * ptr << std::endl; // Prints: 10
882882
883883ptr = &b; // The value of ptr is now the address of the variable 'b'
884- std::cout << p << std::endl; // Prints: 0x2a000088
885- std::cout << * p << std::endl; // Prints: 20
884+ std::cout << ptr << std::endl; // Prints: 0x2a000088
885+ std::cout << * ptr << std::endl; // Prints: 20
886886```
887887
888888```c++
You can’t perform that action at this time.
0 commit comments