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.