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

Function changeIt

Examples/Modules/Chapter 08/Ex8_04.cpp:16–21  ·  view source on GitHub ↗

Function to modify an argument and return it

Source from the content-addressed store, hash-verified

14
15// Function to modify an argument and return it
16double changeIt(double* pit)
17{
18 *pit += 10.0; // This modifies the original double
19 std::cout << "Within function, *pit = " << *pit << std::endl;
20 return *pit;
21}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected