From cd13dfd995aecd8b5586a89f8b8dad479b65d9cc Mon Sep 17 00:00:00 2001 From: Li-YangZhong <45118543+Li-YangZhong@users.noreply.github.com> Date: Sat, 17 Nov 2018 22:34:21 +0800 Subject: [PATCH 1/2] Update Ex5_12.cpp right sqaure bracket "]" is missing from line 20 --- Beginning C++ 17 source code/Examples/Chapter 05/Ex5_12.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Beginning C++ 17 source code/Examples/Chapter 05/Ex5_12.cpp b/Beginning C++ 17 source code/Examples/Chapter 05/Ex5_12.cpp index 1f52cb3..d1ec94e 100644 --- a/Beginning C++ 17 source code/Examples/Chapter 05/Ex5_12.cpp +++ b/Beginning C++ 17 source code/Examples/Chapter 05/Ex5_12.cpp @@ -17,7 +17,7 @@ int main() { std::cout <<"Enter a height: "; std::cin >> height[entered]; - if (height[entered > 0]) // Make sure value is positive + if (height[entered] > 0]) // Make sure value is positive { ++entered; } From 2f6b748727632994f1d827eef5f805df85b03f9a Mon Sep 17 00:00:00 2001 From: Li-YangZhong <45118543+Li-YangZhong@users.noreply.github.com> Date: Thu, 6 Dec 2018 15:31:40 +0800 Subject: [PATCH 2/2] Update Soln7_01.cpp Line 39 needs to be revised to make sure no trailing /n is put in the variable name. --- .../Exercises/Chapter 07/Soln7_01.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Beginning C++ 17 source code/Exercises/Chapter 07/Soln7_01.cpp b/Beginning C++ 17 source code/Exercises/Chapter 07/Soln7_01.cpp index 7b271fc..506315d 100644 --- a/Beginning C++ 17 source code/Exercises/Chapter 07/Soln7_01.cpp +++ b/Beginning C++ 17 source code/Exercises/Chapter 07/Soln7_01.cpp @@ -36,7 +36,7 @@ int main() std::cout << "Do you wish to enter another student's details (y/n): "; char answer {}; - std::cin >> answer; + std::cin >> answer;//this statement will cause next name to contain only /n and skipped over. if (std::toupper(answer) == 'N') break; } @@ -57,4 +57,4 @@ int main() std::cout << std::endl; } std::cout << std::endl; -} \ No newline at end of file +}