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; } 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 +}