listings-Chap07-README.md
Listings of Chap07.docx
This is linked summary of the listings. You can also view it on one page.
- Listing 07.1 Use functions.
- Book: lst-0008-book.cpp
- Godbolt: lst-0008-godb.cpp, https://godbolt.org/z/TdrebYodx
- Listing 07.2: Different return types of functions.
- Book: lst-0009-book.cpp
- Listing 07.3 Parameters are initially passed as a value.
- Book: lst-0010-book.cpp
- Godbolt: lst-0010-godb.cpp, https://godbolt.org/z/8zcvMdM3b
- Listing 07.4: Add an ampersand to make it a reference parameter.
- Book: lst-0011-book.cpp
- Godbolt: lst-0011-godb.cpp, https://godbolt.org/z/63dTshz3Y
- Listing 07.5: You can use constant references as parameters for any call.
- Book: lst-0012-book.cpp
- Godbolt: lst-0012-godb.cpp, https://godbolt.org/z/dcKnx3Pno
- GodboltId:oh91YvaqT
- Book: lst-0014-book.cpp
- Godbolt: lst-0014-godb.cpp, https://godbolt.org/z/oh91YvaqT
- GodboltId:q4ov41cnv
- Book: lst-0015-book.cpp
- Godbolt: lst-0015-godb.cpp, https://godbolt.org/z/q4ov41cnv
- Listing 07.6 Various definitions of functions.
- Book: lst-0016-book.cpp
- Listing 07.7: A forward declaration without a function body.
- Book: lst-0017-book.cpp
- Listing 07.8: Some conversions take place here. The conversions may look different on your system.
- Book: lst-0019-book.cpp
- Godbolt: lst-0019-godb.cpp, https://godbolt.org/z/zb1T7Kr3G
- Listing 07.9: The “print” and “add” functions have been overloaded for multiple types.
- Book: lst-0021-book.cpp
- Godbolt: lst-0021-godb.cpp, https://godbolt.org/z/9YcPraT15
- GodboltId:58cTfvYhe
- Book: lst-0024-book.cpp
- Godbolt: lst-0024-godb.cpp, https://godbolt.org/z/58cTfvYhe
- GodboltId:evGqG1oqa
- Book: lst-0025-book.cpp
- Godbolt: lst-0025-godb.cpp, https://godbolt.org/z/evGqG1oqa
- Listing 07.10: Default parameters act like multiple overloads.
- Book: lst-0028-book.cpp
- Godbolt: lst-0028-godb.cpp, https://godbolt.org/z/fjc37rvEr
- Listing 07.11: Alternative syntax for function declarations with trailing return type.
- Book: lst-0033-book.cpp
- Listing 8.12: Since C++14, you can let the compiler deduce the return type.
- Book: lst-0034-book.cpp
- Godbolt: lst-0034-godb.cpp, https://godbolt.org/z/6d5fxn9ed
- GodboltId:dMvqG85fr
- Book: lst-0038-book.cpp
- Godbolt: lst-0038-godb.cpp, https://godbolt.org/z/dMvqG85fr
- GodboltId:8Gdso36zf
- Book: lst-0039-book.cpp
- Godbolt: lst-0039-godb.cpp, https://godbolt.org/z/8Gdso36zf