From 070ffe868beda32a09d430a35fcbc8159eb8da8e Mon Sep 17 00:00:00 2001 From: shadow <773850645@qq.com> Date: Wed, 11 Mar 2020 17:29:11 +0800 Subject: [PATCH 1/2] correction --- ch05/exercise5_19.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch05/exercise5_19.cpp b/ch05/exercise5_19.cpp index 2b69b3d..81e4ae9 100644 --- a/ch05/exercise5_19.cpp +++ b/ch05/exercise5_19.cpp @@ -11,7 +11,7 @@ int main() cout << "Input two strings: "; string str1, str2; cin >> str1 >> str2; - cout << (str1 <= str2 ? str1 : str2) + cout << (str1.size() <= str2.size() ? str1 : str2) << " is less than the other. " << "\n\n" << "More? Enter yes or no: "; cin >> rsp; From 16f3f4678f8badc9cefbbe2adffb7ca199d68bee Mon Sep 17 00:00:00 2001 From: shadow <773850645@qq.com> Date: Wed, 11 Mar 2020 22:33:56 +0800 Subject: [PATCH 2/2] add const --- ch06/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch06/README.md b/ch06/README.md index c7502ee..d54d9da 100644 --- a/ch06/README.md +++ b/ch06/README.md @@ -189,7 +189,7 @@ bool is_empty(const string& s) { return s.empty(); } * (b) 名为 change_val 的函数,返回vector的迭代器,有两个参数:一个是int,另一个是vector的迭代器。 ```cpp -(a) bool compare(matrix &m1, matrix &m2); +(a) bool compare(const matrix &m1, const matrix &m2); (b) vector::iterator change_val(int, vector::iterator); ```