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

Function main

Examples/Modules/Chapter 12/Ex12_07/Ex12_07.cpp:5–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import box;
4
5int main()
6{
7 Box myBox {3.0, 4.0, 5.0};
8 std::cout << "myBox dimensions are " << myBox.getLength()
9 << " by " << myBox.getWidth()
10 << " by " << myBox.getHeight() << std::endl;
11
12 myBox.setLength(-20.0); // ignored!
13 myBox.setWidth(40.0);
14 myBox.setHeight(10.0);
15 std::cout << "myBox dimensions are now " << myBox.getLength() // 3 (unchanged)
16 << " by " << myBox.getWidth() // by 40
17 << " by " << myBox.getHeight() << std::endl; // by 10
18}

Callers

nothing calls this directly

Calls 6

getLengthMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
setLengthMethod · 0.45
setWidthMethod · 0.45
setHeightMethod · 0.45

Tested by

no test coverage detected