From 191b30533e0644bbdc174c2325fe186ba9093b1b Mon Sep 17 00:00:00 2001 From: huihut Date: Wed, 14 Apr 2021 00:27:04 +0800 Subject: [PATCH] constant members cannot be updated https://github.com/huihut/interview/issues/78 https://github.com/huihut/interview/issues/77 --- README.md | 2 +- README_en.md | 2 +- docs/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8c0efe8..12c43e1 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ public: void function() { // 对象 - A b; // 普通对象,可以调用全部成员函数、更新常成员变量 + A b; // 普通对象,可以调用全部成员函数 const A a; // 常对象,只能调用常成员函数 const A *p = &a; // 指针变量,指向常对象 const A &q = a; // 指向常对象的引用 diff --git a/README_en.md b/README_en.md index 1c7e57d..3f9a2c0 100644 --- a/README_en.md +++ b/README_en.md @@ -102,7 +102,7 @@ public: void function() { // object - A b; // ordinary object, can call all member functions, update constant member variables + A b; // ordinary object, can call all member functions const A a; // constant object, can only call constant member functions const A *p = &a; // pointer variable, point to a constant object const A &q = a; // reference to constant object diff --git a/docs/README.md b/docs/README.md index 641785d..c34ae1e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -90,7 +90,7 @@ public: void function() { // 对象 - A b; // 普通对象,可以调用全部成员函数、更新常成员变量 + A b; // 普通对象,可以调用全部成员函数 const A a; // 常对象,只能调用常成员函数 const A *p = &a; // 指针变量,指向常对象 const A &q = a; // 指向常对象的引用