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

Function fillVector_1toN

Examples/Modules/Chapter 20/Ex20_14B/Ex20_14B.cpp:36–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36std::vector<int> fillVector_1toN(size_t N)
37{
38 std::vector<int> numbers;
39 for (int i{ 1 }; i <= N; ++i)
40 numbers.push_back(i);
41 return numbers;
42}
43
44void printVector(std::string_view message, const std::vector<int>& numbers)
45{

Callers 1

mainFunction · 0.70

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected