O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, fifth edition by Rogers Cadenhead, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required