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

Function buildStringArray

Examples/Modules/Chapter 18/Ex18_02/Ex18_02.cpp:7–13  ·  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

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

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected