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

Function main

Exercises/NoModules/Chapter 10/Soln10_03.cpp:30–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30int main()
31{
32 int n{ plus(3, 4) };
33 std::cout << "plus(3, 4) returns " << n << std::endl;
34
35 double d{ plus(3.2, 4.2) };
36 std::cout << "plus(3.2, 4.2) returns " << d << std::endl;
37
38 std::string s1{ "aaa" };
39 std::string s2{ "bbb" };
40 auto s3{ plus(s1, s2) };
41 std::cout << "With s1 as " << s1 << " and s2 as " << s2 << std::endl;
42 std::cout << "plus(s1, s2) returns " << s3 << std::endl;
43
44 // The extra part:
45 std::string s{ plus("he", "llo") };
46 std::cout << "plus(\"he\", \"llo\") returns " << s << std::endl;
47}

Callers

nothing calls this directly

Calls 1

plusFunction · 0.70

Tested by

no test coverage detected