18 C++ as a Better C Introducing Object Technology o 2007 Pearson education nc. All rights reserved
© 2007 Pearson Education, Inc. All rights reserved. 1 18 C++ as a Better C; Introducing Object Technology
OBJECTIVES In this chapter you will learn Several C++ enhancements to c The header files of the C++ standard library To use inline functions To create and manipulate references To use default function arguments To use the unary scope resolution operator to access a global variable in a scope that contains a local variable of the same name To overload function definitions To create and use function templates that perform identical operations on many different types o 2007 Pearson education nc. All rights reserved
© 2007 Pearson Education, Inc. All rights reserved. 2 OBJECTIVES In this chapter you will learn: ▪ Several C++ enhancements to C. ▪ The header files of the C++ Standard Library. ▪ To use inline functions. ▪ To create and manipulate references. ▪ To use default function arguments. ▪ To use the unary scope resolution operator to access a global variable in a scope that contains a local variable of the same name. ▪ To overload function definitions. ▪ To create and use function templates that perform identical operations on many different types
0.1 Introduction 18.2C+ o 18.3 A Simple Program: Adding Two Integers 18.4 C++ Standard Library 18.5 Header files 18.6 nline Functions 18.7 References and Reference Parameters o 2007 Pearson Education, Inc. All rights reserved
© 2007 Pearson Education, Inc. All rights reserved. 3 18.1 Introduction 18.2 C++ 18.3 A Simple Program: Adding Two Integers 18.4 C++ Standard Library 18.5 Header Files 18.6 Inline Functions 18.7 References and Reference Parameters
4 g 18.8 Empty Parameter Lists 18.9 Default Arguments o 18.10 Unary Scope Resolution Operator 18.11 Function Overloading 18.12 Function Templates 18.13 Introduction to Object Technology and the UML 18.14 Wrap-Up o 2007 Pearson Education, Inc. All rights reserved
© 2007 Pearson Education, Inc. All rights reserved. 4 18.8 Empty Parameter Lists 18.9 Default Arguments 18.10 Unary Scope Resolution Operator 18.11 Function Overloading 18.12 Function Templates 18.13 Introduction to Object Technology and the UML 18.14 Wrap-Up
5 18.1 Introduction The c++ section introduces two additional programming paradigms Object-oriented programming With classes, encapsulation, objects, operator overloading. inheritance and polymorphism Generic programming With function templates and class templates Emphasize crafting valuable classes"'to create reusable software componentry o 2007 Pearson Education, Inc. All rights reserved
© 2007 Pearson Education, Inc. All rights reserved. 5 18.1 Introduction • The C++ section introduces two additional programming paradigms – Object-oriented programming • With classes, encapsulation, objects, operator overloading, inheritance and polymorphism – Generic programming • With function templates and class templates • Emphasize “crafting valuable classes” to create reusable software componentry