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

Function main

Exercises/NoModules/Chapter 17/Soln17_01/Soln17_01.cpp:6–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <iostream>
5
6int main()
7{
8 const unsigned numElements{ 100 };
9
10 Array<unsigned> squares; // default construction
11 for (unsigned i {}; i < numElements; ++i)
12 squares.push_back(i * i); // push_back()
13
14 std::cout << squares.getSize() << " squares were added." << std::endl;
15 std::cout << "For instance: 13 squared equals " << squares[13] << std::endl;
16}

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected