Functions

Chris Wild & Steven Zeil

May 25, 2013

Course Home   e-mail

The basic C++ language is relatively primitive. Its basic data types (integers, reals and characters) and operations on them (addition, subtraction, etc). are limited.

To build complex programs one needs to combine these primitive elements into larger building blocks. Then we compose the entire program from a combination of these building blocks.

In C++, functions are building blocks composed of groups of related statements.

Later in this course, we will look at modules, which are building blocks made from a combination of functions, variables, and data types. Eventually, we will see that the C++ class is a good way to implement most modules.

It’s even possible to go further. (Think back to our discussion in the orientation about scaling up to larger and larger projects.) We can combine classes into larger building blocks called namespaces, but we won’t get there in this course.

1 Functions
2 Example
3 Tips
4 Overloading

[Previous]