summaryrefslogtreecommitdiffhomepage
path: root/c++.html.markdown
diff options
context:
space:
mode:
authorMark Keller <8452750+keller00@users.noreply.github.com>2024-06-18 03:35:08 -0400
committerGitHub <noreply@github.com>2024-06-18 09:35:08 +0200
commit887d6e0653ddbec5f24179ac640509484f94d49d (patch)
tree379c3a5edd8abf8a402d50bb6ba891b7f686926f /c++.html.markdown
parent06383371ef3eb376989a37fb6994b1624be5627d (diff)
Move comment in c++.html.markdown (#4979)
Diffstat (limited to 'c++.html.markdown')
-rw-r--r--c++.html.markdown2
1 files changed, 1 insertions, 1 deletions
diff --git a/c++.html.markdown b/c++.html.markdown
index 6d039c33..7adb5244 100644
--- a/c++.html.markdown
+++ b/c++.html.markdown
@@ -263,10 +263,10 @@ std::string& fooRef = foo; // This creates a reference to foo.
fooRef += ". Hi!"; // Modifies foo through the reference
std::cout << fooRef; // Prints "I am foo. Hi!"
+std::cout << &fooRef << '\n'; // Prints the address of foo
// Doesn't reassign "fooRef". This is the same as "foo = bar", and
// foo == "I am bar"
// after this line.
-std::cout << &fooRef << '\n'; // Prints the address of foo
fooRef = bar;
std::cout << &fooRef << '\n'; // Still prints the address of foo
std::cout << fooRef << '\n'; // Prints "I am bar"