A function is a block of code that carries out a specific task or action and can be reused later on.
Functions allow us to:
There are 3 main components to consider when writing a basic function in C++:
Now that we know the components of a function, we can look at the actual syntax for writing one
Here's an example of a simple function declaration
std::string capitalize_name(std::string name) { // Code here… }