diff options
author | Levi Bostian <levi.bostian@gmail.com> | 2014-12-02 00:12:50 -0600 |
---|---|---|
committer | Levi Bostian <levi.bostian@gmail.com> | 2014-12-02 00:12:50 -0600 |
commit | 41fc9a3d7726a84c8d474c0fa88809ca0c38f4c0 (patch) | |
tree | 73340e4c1ec531ce8ab3e68e1234d331d6d166eb /c++.html.markdown | |
parent | 64e8850f3737d8a46a631b5a8a632e33041ad7c3 (diff) | |
parent | 62d014ce3a351d43fd354d8cdb4c92ae30be9d75 (diff) |
Merge pull request #880 from geoffliu/master
[C++/en] Slight nit to pick.
Diffstat (limited to 'c++.html.markdown')
-rw-r--r-- | c++.html.markdown | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/c++.html.markdown b/c++.html.markdown index 9f357b08..5f80f26f 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -238,7 +238,10 @@ string& fooRef = foo; // This creates a reference to foo. fooRef += ". Hi!"; // Modifies foo through the reference cout << fooRef; // Prints "I am foo. Hi!" -fooRef = bar; // Error: references cannot be reassigned. +// Doesn't reassign "fooRef". This is the same as "foo = bar", and +// foo == "I am bar" +// after this line. +fooRef = bar; const string& barRef = bar; // Create a const reference to bar. // Like C, const values (and pointers and references) cannot be modified. |