w05-bsc-function-basics-1
Function basics
In this example, we explore the basics of passing and returning arguments either by value or by reference.
Go into tehpc/basics/
. Consider the following code:
bsc_functions_1.cpp
Compile the code by
- going into the
tehpc/build/
folder (possibly in another terminal) - compile with the following command:
g++ -Werror -Wpedantic -g -o bsc_functions_1 ../basics/bsc_functions_1.cpp
.
If you compile on Mac, consider adding the following compile option -std=c++17
.
Compling the code will throw out a few errors.
- Please solve all errors.
- Check if the printed results are correct and correct the code if they are not.