tailieunhanh - Giáo trình tin học chương 3

Program Components in C++ • Modules: functions and classes • Programs use new and “prepackaged” modules – New: programmer-defined functions, classes – Prepackaged: from the standard library • Functions invoked by function call – Function name and information (arguments) it needs • Function definitions – Only written once – Hidden from other functions | 1 Chapter 3 - Functions Outline Introduction Program Components in C Math Library Functions Functions Function Definitions Function Prototypes Header Files Random Number Generation Example A Game of Chance and Introducing enum Storage Classes Scope Rules Recursion Example Using Recursion The Fibonacci Series Recursion vs. Iteration Functions with Empty Parameter Lists 2003 Prentice Hall Inc. All rights reserved. 2 Chapter 3 - Functions Outline Inline Functions References and Reference Parameters Default Arguments Unary Scope Resolution Operator Function Overloading Function Templates 2003 Prentice Hall Inc. All rights reserved. 3 Introduction Divide and conquer - Construct a program from smaller pieces or components - Each piece more manageable than the original program 2003 Prentice Hall Inc. All rights .

TỪ KHÓA LIÊN QUAN