Hour 5. Calling Functions

What Is a Function?

A function is a section of a program that can act on data and return a value. Every C++ program has at least one function, the main() function called automatically when the program runs. This function can contain statements that call other functions, some of which might call others, and so on.

Each function has a name that’s used to call the function. The execution of the program branches to the first statement in that function and continues until it reaches a return statement or the last statement of the function. At that point, ...

Get Sams Teach Yourself C++ in 24 Hours, fifth edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.