Skip to content

Commit c5b17e2

Browse files
author
Joe Gibson
authored
Merge pull request gibsjose#27 from Damercy/patch-1
Renamed p to ptr in References/Pointers section
2 parents 3cc3dd5 + f7c1cb3 commit c5b17e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

C++ Syntax.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,12 +877,12 @@ int * ptr = nullptr; // ptr is a separate variable whose type is 'poi
877877
printf("ptr = %p\n"); // Prints: 0x0
878878

879879
ptr = &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

883883
ptr = &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++

0 commit comments

Comments
 (0)