出版時(shí)間:2009-9 出版社:清華大學(xué)出版社 作者:巴拉古路薩米 頁數(shù):631
Tag標(biāo)簽:無
前言
Object-Oriented Programming (OOP) has become the preferred programming approach bythe software industries, as it offers a powerful way to cope with the complexity of real-worldproblems. Among the OOP languages available today, C++ is by far the most widely usedlanguage.Since its creation by Bjarne Stroustrup in early 1980s, C++ has undergone many changesand improvements. The language was standardized in 1998 by the American NationalStandards Institute (ANSI) and the International Standards Organization (ISO) byincorporating not only the new features but also the changes suggested by the user groups.This book has been thoroughly revised and this edition confirms to the specifications ofANSI/ISO standards. Besides confirming to the standards, many smaller changes andadditions to strengthen the existing topics as well as corrections to typographical errors andcertain inaccuracies in the text have been incorporated. The highlight of this edition is theinclusion of two new programming projects in Appendix A - (1) Menu Based CalculationSystem and (2) Banking System that demonstrate how to integrate the various features ofC++ in real life applications.This book is for the programmers who wish to know all about C++ language and object-oriented programming. It explains in a simple and easy-to-understand style the what, whyand how of object-oriented programming with C++. The book assumes that the reader isalready familiar with C language, although he or she need not be an expert programmer. The book provides numerous examples, illustrations and complete programs. The sampleprograms are meant to be both simple and educational. Wherever necessary, pictorialdescriptions of concepts are included to improve clarity and facilitate better understanding.The book also presents the concept of object-oriented approach and discusses briefly theimportant elements of object-oriented analysis and design of systems.
內(nèi)容概要
本書以一種簡單易懂的寫作風(fēng)格,介紹了何謂C++面向?qū)ο蟪绦蛟O(shè)計(jì)、為什么以及如何用C++進(jìn)行面向?qū)ο蟪绦蛟O(shè)計(jì)。書給出了大量的示例、演示說明以及完整的程序。這些示例程序既簡單也很具有教學(xué)意義。在必要的時(shí)候,本書還使用了概念圖,使得介紹更加清晰,便于更好地理解。本書還介紹了面向?qū)ο蠓椒ǖ母拍睿喴懻摿讼到y(tǒng)的面向?qū)ο蠓治雠c設(shè)計(jì)的重要內(nèi)容。本書的最大亮點(diǎn)是附錄A的兩個(gè)新的程序設(shè)計(jì)項(xiàng)目:(1)基于菜單的計(jì)算系統(tǒng);(2)銀行系統(tǒng)。它們演示了如何在現(xiàn)實(shí)應(yīng)用程序中集成C++的各種特性?! ”緯粌H可以作為高等院校C++面向?qū)ο蟪绦蛟O(shè)計(jì)的教材,也是希望了解C++語言和面向?qū)ο蟪绦蛟O(shè)計(jì)知識(shí)的專業(yè)人員的很好參考書。
作者簡介
作者:(印度)巴拉古路薩米(E Balagurusamy)
書籍目錄
Preface xiii1 Principles of Object-Oriented Programming 1.1 Software Crisis 1.2 Software Evolution 1.3 A Look at Procedure-Oriented Programming 1.4 Object-Oriented Programming Paradigm 1.5 Basic Concepts of object-Oriented Programming 1.6 Benefits of OOP 1.7 Object-Oriented Languages 1.8 Applications of OOP Summary Review Questions 2 Beginning with C++ 2.1 Whatis C++? 2.2 Applications of C++ 2.3 A Simple C++ Program 2.4 More C++ Statements 2.5 An Example with Class 2.6 Structure of C++ Program 2.7 Creating the Source File 2.8 Compiling and Linking Summary Review Questions Debugging Exercises Programming Exercises 3 Tokens,Expressions and Control Structures 3.1 Introduction 3.2 Tokens 3.3 KeyWords 3.4 Identifiers and Constants 3.5 Basic Data Types 3.6 User-Defined Data Types 3.7 DeriVed Data Types 3.8 SymbolicConstants 3.9 Type Compatibility 3.10 Declaration of Variables 3.11 Dynamic initialization of Variables 3.12 Reference Variables 3.13 Operators in C++ 3.14 Scope Resolution Operator 3.15 Member Dereferencing Operators 3.16 Memory Management Operators 3.17 Manipulators 3.18 Type Cast Operator 3.19 EXPressions and their Types 3.20 SpecialAssignment Expressions 3.21 Implicit Conversions 3.22 Operator Overloading 3.23 Operator Precedence 3.24 Control Structures Summary Review Questions Debugging Exercises Programming Exercises 4 Functions in C++ 4.1 Introduction 4.2 The Main Function 4.3 Function Prototyping 4.4 Call by Reference 4.5 Return by Reference 4.6 Inline Functions 4.7 DefaultArgUments 4.8 constArgUments 4.9 Function Overloading 4.10 Friend and Virtual Functions 4.11 Math Library Functions Summary Review Questions Debugging Exercises 5 Classes and Objects Programming Exercises 5.1 Introduction 5.2 C Structures Revisited 5.3 Specifying a Class ……6 Constructors and Destructors 7 Operator Overloading and Type Conversions8 Inheritance:Extending Classes9 Pointers,Virtual Functions and Polymorphism10 Managing Console I/O Operations 11 Working with Files12 Templates13 Exception Handling 14 Introduction to the Standard Template Library15 Manipulating Strings16 New Featrues of ANSI C++ Standard 17 Object-Oriented Ststems DevelopmentAppendix A: Proj'ects Appendix B: EMcuting Turbo C+ + Appendix C: executing C+ + Under Windows Appendix D: Glossary of ANSI C+ + Keywords Appendix E: C+ + OPeratorprCcedence Appendix F: POints to Remember Appendix G: Glossary of important C+ + and OOP Terms Appendix H: C+ + Proficiency Test Bibliography
章節(jié)摘錄
插圖:not only creates the object intl of type integer but also initializes its data members m andn to zero. There is no need to write any statement to invoke the constructor function (as wedo with the normal member functions). If a 'normal' member function is defined for zeroinitialization, we would need to invoke this function for each of the objects separately. Thiswould be very inconvenient, if there are a large number of objects. A constructor that accepts no parameters is called the default constructor. The defaultconstructor for class A is At.A0. If no such constructor is defined, then the compiler suppliesa default constructor. Therefore a statement such asA a;invokes the default constructor of the compiler to create the object a. The constructor functions have some special characteristics. These are :They should be declared in the public section.They are invoked automatically when the objects are created.They do not have return types, not even void and therefore, and they cannot return values.They cannot be inherited, though a derived class can call the base class constructor.Like other C++ functions, they can have default arguments.Constructors cannot be virtual. (Meaning of virtual will be discussed later in Chapter 9.)We cannot refer to their addresses.An object with a constructor (or destructor) cannot be used as a member of a union.They make 'implicit calls' to the operators new and delete when memory alloca-tion is required.
編輯推薦
《C++面向?qū)ο蟪绦蛟O(shè)計(jì)(第4版)》:大學(xué)計(jì)算機(jī)教育國外著名教材系列(影印版)
圖書封面
圖書標(biāo)簽Tags
無
評(píng)論、評(píng)分、閱讀與下載
C++面向?qū)ο蟪绦蛟O(shè)計(jì) PDF格式下載