Skip to main content

Section 12.1 Single Functions

You have already seen the use of a function in C, namely the main() function! We don’t tend to think of main() as a function but it is indeed one.
Functions allow you to group a bunch of statements together that can be called upon to execute at any point in your code. Depending on the type of function you write, you can pass information to the function and it can return information back to you.
Here is a first example of a function in C:

If you cannot see this codecast, please click here.

Aside: Video Description.