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

Function fillVector_1toN

Examples/Modules/Chapter 20/Ex20_14A/Ex20_14A.cpp:27–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27std::vector<int> fillVector_1toN(size_t N)
28{
29 std::vector<int> numbers;
30 for (int i{ 1 }; i <= N; ++i)
31 numbers.push_back(i);
32 return numbers;
33}
34
35void printVector(std::string_view message, const std::vector<int>& numbers)
36{

Callers 1

mainFunction · 0.70

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected