From 39f320ed80a0f8e8e7d838dc1656377a1df6eff3 Mon Sep 17 00:00:00 2001 From: ktleungai Date: Sat, 11 Jun 2022 13:55:18 +0800 Subject: [PATCH] Fix exercise 2.32 --- ch2/2.32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch2/2.32.cpp b/ch2/2.32.cpp index 11327bc..3c96196 100644 --- a/ch2/2.32.cpp +++ b/ch2/2.32.cpp @@ -5,7 +5,7 @@ int main() { // Method 1 const int null1 = 0; - int *p1 = null1; + const int *p1 = &null1; // Method 2 int *p2 = nullptr; @@ -18,7 +18,7 @@ int main() { // Method 5 constexpr int null2 = 0; - int *p5 = null2; + const int *p5 = &null2; return 0; }