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

Function buildStringArray

Examples/Modules/Chapter 18/Ex18_07/Ex18_07.cpp:10–16  ·  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

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

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected