// fig06_01.cpp // Initializing an array's elements to zeros and printing the array. //#include <../libraries/fmt/include/format.h> // C++20: This will be #include #include #include #include #include template void printArray(T& a, std::string tag){ std::cout << "Element Value ---> "< values{}; // values is an array of 5 int values std::array floatarray; std::vector floatvector(20, 0); for (size_t i{0}; i < floatarray.size(); i++) floatarray[i] = i*i/10.0; // initialize elements of array values to 0 for (size_t i{0}; i < values.size(); ++i) { values[i] = i*i; // set element at location i to 0 } printArray(values,"values"); printArray(floatarray,"floatarray"); printArray(floatvector, "floatvector"); std::cout << "Element Value\n" << "\n"; floatvector.resize(5); printArray(floatvector,"floatvector resized"); // access elements via the at member function for (size_t i{0}; i < values.size(); ++i) { std::cout << i<