MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / show_data

Function show_data

Examples/Modules/Chapter 08/Ex8_11.cpp:26–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void show_data(const int data[], size_t count, const std::string& title,
27 size_t width, size_t perLine)
28{
29 std::cout << title << std::endl; // Display the title
30
31 // Output the data values
32 for (size_t i {}; i < count; ++i)
33 {
34 std::cout << std::format("{:{}}", data[i], width); // Display a data item
35 if ((i+1) % perLine == 0) // Newline after perLine values
36 std::cout << '\n';
37 }
38 std::cout << std::endl;
39}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected