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

Function buildStringArray

Examples/Modules/Chapter 18/Ex18_03/Ex18_03.cpp:6–12  ·  view source on GitHub ↗

Construct an Array<> of a given size, filled with some arbitrary string data

Source from the content-addressed store, hash-verified

4
5// Construct an Array<> of a given size, filled with some arbitrary string data
6Array<std::string> buildStringArray(const size_t size)
7{
8 Array<std::string> result{ size };
9 for (size_t i {}; i < size; ++i)
10 result[i] = "You should learn from your competitor, but never copy. Copy and you die.";
11 return result;
12}
13
14int main()
15{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected