From e3094b598766573e6aab191279e287a045d113b9 Mon Sep 17 00:00:00 2001 From: Jason Wang <12841205+bestwbr@users.noreply.github.com> Date: Fri, 7 Aug 2020 15:08:58 +0800 Subject: [PATCH] Fix typo in memory section --- README.md | 2 +- cheatsheet-as-sourcefile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 481ab84..5c3d56f 100644 --- a/README.md +++ b/README.md @@ -322,7 +322,7 @@ if (y == nullptr) { // Can compare against nullptr (here returns true) cout << "Empty"; } y = make_shared(15); // Assign new value -cout << *y; // Dereference x to print '15' +cout << *y; // Dereference y to print '15' cout << *x; // Dereference x to print '12' weak_ptr w; // Create empty weak pointer w = y; // w has weak reference to y. diff --git a/cheatsheet-as-sourcefile.cpp b/cheatsheet-as-sourcefile.cpp index 0d3dedd..4fd009b 100644 --- a/cheatsheet-as-sourcefile.cpp +++ b/cheatsheet-as-sourcefile.cpp @@ -307,7 +307,7 @@ if (y == nullptr) { // Can compare against nullptr (here returns true) cout << "Empty"; } y = make_shared(15); // Assign new value -cout << *y; // Dereference x to print '15' +cout << *y; // Dereference y to print '15' cout << *x; // Dereference x to print '12' weak_ptr w; // Create empty weak pointer w = y; // w has weak reference to y.