From 53d0bd2b176ea176419b5a2a0413a869b3a188a3 Mon Sep 17 00:00:00 2001 From: Isa Date: Sun, 14 May 2023 10:35:37 +0300 Subject: [PATCH] Update fig06_02.cpp - values2 Here, it is a syntax error that values2 is initialized and never used, so the results of the executed program do not agree with those shown in the book. --- examples/ch06/fig06_02.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ch06/fig06_02.cpp b/examples/ch06/fig06_02.cpp index 4615905..da996ae 100755 --- a/examples/ch06/fig06_02.cpp +++ b/examples/ch06/fig06_02.cpp @@ -18,8 +18,8 @@ int main() { std::array values2{1.1, 2.2, 3.3, 4.4}; // output each array element's value - for (size_t i{0}; i < values.size(); ++i) { - std::cout << fmt::format("{} ", values.at(i)); + for (size_t i{0}; i < values2.size(); ++i) { + std::cout << fmt::format("{} ", values2.at(i)); } std::cout << "\n";