书籍详情
面向对象编程:工程和技术人员的C++语言
作者:[加]Goran Svenk著
出版社:清华大学出版社
出版时间:2003-10-01
ISBN:9787302072164
定价:¥39.00
购买这本书可以去
内容简介
本书适用于完成了使用C语方过程化程序设计课程的工程学、工程技术学、计算机科学和计算机研究技术专业的学生。书中包括许多电子工程的实例,因此对于电子工程或电子技术专业的学生更适合。本书适用于中级水平的程序员;同时,本书也是为程序员、工程师或者任何熟悉C而又想学习C++的人准备的。对于已经有了C++编程经验的人而言,从书中也会发现C++程序设计有用的最新发展。GoranSvenk在电子和计算机工程领域具有21年的产业与教育经验,并且编写了大量图书和文章。他从1983年起就在各类学院执教,现在是加拿大安大略省Toronto的SenecaCollege的全职教授,从1997年起他就在此工作,并且开发了许多计算机编程领域的课程。本书适合于有一定编程基础的中高级程序员阅读,书中鼓励用户使用纯粹的面向对象的方法来解决问题。本书首先讨论了C++对C语言过程化编程的增强功能,分析了这两种语言的异同,以方便读者的学习。然后通过丰富的工程技术领域的实际示例引导读者对面向对象的编程檎进行深入的剖析和研究。每一章都饮食了许多程序示例、编程项目、实际案例分析和问题讨论,可以有效地帮助读者学习和掌握新的、有用的C++技巧。另外,本书中的所有内容都基于ANSI/ISO定义的最新的C++标准,使得本书成为一本C++程序员不可或缺的学习和参考书。本书尤其适合作为电子、机电等相关工科专业的C++教材。
作者简介
Goran Svenk 在电子和计算机工程领域具有21年的产业与教育经验,并且编写了大量图书和文章。他从1983年起就在各类学院执教,现在是加拿大安大略省Toronto的Seneca College的全职教授,从1997年起他就在此工作,并且开发了许多计算机编程领域的课程。
目录
1 MOVING FROM C TO C++
1.1 DIFFERENCES BETWEEN C AND C++
1.1.1 THE C++ STANDARD AND COMPILERS
1.1.2 C++ COMMENTS
1.1.3 HEADER FILES
1.1.4 DATA TYPES
1.1.5 RESOLVING SCOPE AND VARIABLE DECLARATIONS
1.1.6 CONSTANTS
1.2 C++ INPUT/OUTPUT
1.2.1 C++ I/O METHODS
1.2.2 C++ FORMATTING
1.3 NAMESPACES
2 C++ FUNCTION ENHANCEMENTS
2.1 C++ PROTOTYPING
2.2 INLINE FUNCTIONS
2.2.1 USING C MACROS
2.2.2 USING INLINE FUNCTIONS
2.3 DEFAULT ARGUMENTS
2.4 FUNCTION OVERLOADING
2.5 FUNCTION TEMPLATES
3 POINTERS, REFERENCES, AND DYNAMIC MEMOPY ALLOCATION
3.1 C++ POINTERS
3.1.1 REVIEWING THE FUNDAMENTALS OF POINTERS
3.1.2 DIFFERENCES BETWEEN C AND C++ POINTERS
3.2 REFERENCES
3.2.1 REFERENCES AS INDEPENDENT VARIABLES
3.2.2 PASSING REFERENCES TO FUNCTIONS
3.2.3 RETURNING REFERENCES BY FUNCTIONS
3.3 USING REFERENCES AND POINTERS WITH CONSTANTS
3.4 DYNAMIC MEMORY ALLOCATION
3.4.1 STATIC VERSUS DYNAMIC MEMORY ALLOCATION
3.4.2 DYNAMIC ARRAYS
3.5 CASE STUDY: LOTTERY RANDOM NUMBER GENERATOR
4 CLASSES AND OBJECTS
4.1 PROCEDURAL VERSUS OBJECT-ORIENTED PROGRAMMING
4.2 C++ STRUCTURES VERSUS C STRUCTURES
4.3 CLASSES
4.3.1 ACCESSING CLASS MEMBERS
4.3.2 MEMBER FUNCTIONS
4.3.3 ALLOCATING OBJECTS AT RUN-TIME
4.4 CONSTRUCTOR AND DESTRUCTOR FUNCTIONS
4.4.1 CONSTRUCTORS
4.4.2 THE CLASS DESTRUCTOR
4.5 CASE STUDY: DATA ENCRYPTION
5 CLASSES: ADVANCED TOPICS
5.1 PASSING TO AND RETURNING OBJECTS FROM FUNCTIONS
5.2 COPY CONSTRUCTOR
5.3 FRIEND FUNCTIONS AND CLASSES
5.3.1 FRIEND FUNCTIONS
5.3.2 FRIEND CLASSES
5.4 STATIC MEMBERS
5.4.1 STATIC DATA MEMBERS
5.4.2 STATIC MEMBER FUNCTIONS
5.5 THE this POINTER
5.6 CONSTANT MEMBER FUNCTIONS
6 OPERATOR OVERLOADING
6.1 FUNDAMENTALS OF OPERATOR OVERLOADING
6.2 OPERATOR FUNCTIONS
6.3 OVERLOADING BINARY OPERATORS
6.4 OVERLOADING UNARY OPERATORS
6.5 OVERLOADING THE STREAM OPERATORS
6.6 CASE STUDY: AC CURRENT CALCULATOR
7 INHERITANCE
7.1 FUNDAMENTALS OF INHERITANCE
7.2 THE protected ACCESS SPECIFIER
7.3 CONSTRUCTING AND DESTROYING DERIVED CLASSES
7.4 MULTIPLE INHERITANCE
7.4.1 DIRECT MULTIPLE INHERITANCE
7.4.2 INDIRECT MULTIPLE INHERITANCE
7.5 DOMINATING AND OVERRIDING BASECLASS MEMBERS
8 COMPOSITION
8.1 COMPOSITION VERSUS INHERITANCE
8.2 USING COMPOSITION
8.3 CONSTRUCTING AND DESTROYING COMPOSED CLASSES
8.4 COMBINING INHERITANCE AND COMPOSITION
8.5 CASE STUDY: COMPUTER SYSTEM CONFIGURATOR
9 POLYMORPHISM AND VIRTUAL FUNCTIONS
9.1 DYNAMIC VERSUS STATIC BINDING
9.2 VIRTUAL FUNCTIONS
9.3 ABSTRACT BASE CLASSES
9.4 VIRTUAL DESTRUCTORS
9.5 USING POLYMORPHISM
9.6 CASE STUDY: LOGIC CIRCUIT CALCULATOR
10 TEMPLATES
10.1 CLASS TEMPLATES
10.1.1 Template Parameters
10.1.2 Member Functions of Class Templates
10.1.3 Using Friends and Static Members with Class Templates
10.1.4 Using the void Pointer
10.2 TEMPLATES AND INHERITANCE
10.3 CONTAINERS AND ITERATORS
10.3.1 Sequence Containers
10.3.2 Associative Containers
10.3.3 Iterators
10.4 STANDARD TEMPLATE LIBRARY (STL)
11 EXCEPTION HANDLING
11.1 FUNDAMENTALS OF EXCEPTION HANDLING
11.2 USING try-throw-catch
11.2.1 Throwing and Handling an Exception
11.2.2 Exception Specifications
11.3 HANDLING MEMORY ALLOCATION ERRORS
11.4 EXCEPTIONS AND CLASSES
12 FILE I/O
12.1 STEPS IN FILE I/O PROCESSING
12.1.1 Creating a File Object
12.1.2 Opening a File
12.1.3 Using a File
12.1.4 Closing a File
12.2 SEQUENTIAL FILES
12.3 RANDOM-ACCESS FILES
APPENDIX A C++ KEYWORDS AND SYNONYMS
APPENDIX B C++ OPERATORS
APPENDIX C STANDARD C++ LIBRARY
APPENDIX D STANDARD C++ ALGORITHMS
APPENDIX E ANSWERS TO ODD-NUMBERED QUESTIONS
1.1 DIFFERENCES BETWEEN C AND C++
1.1.1 THE C++ STANDARD AND COMPILERS
1.1.2 C++ COMMENTS
1.1.3 HEADER FILES
1.1.4 DATA TYPES
1.1.5 RESOLVING SCOPE AND VARIABLE DECLARATIONS
1.1.6 CONSTANTS
1.2 C++ INPUT/OUTPUT
1.2.1 C++ I/O METHODS
1.2.2 C++ FORMATTING
1.3 NAMESPACES
2 C++ FUNCTION ENHANCEMENTS
2.1 C++ PROTOTYPING
2.2 INLINE FUNCTIONS
2.2.1 USING C MACROS
2.2.2 USING INLINE FUNCTIONS
2.3 DEFAULT ARGUMENTS
2.4 FUNCTION OVERLOADING
2.5 FUNCTION TEMPLATES
3 POINTERS, REFERENCES, AND DYNAMIC MEMOPY ALLOCATION
3.1 C++ POINTERS
3.1.1 REVIEWING THE FUNDAMENTALS OF POINTERS
3.1.2 DIFFERENCES BETWEEN C AND C++ POINTERS
3.2 REFERENCES
3.2.1 REFERENCES AS INDEPENDENT VARIABLES
3.2.2 PASSING REFERENCES TO FUNCTIONS
3.2.3 RETURNING REFERENCES BY FUNCTIONS
3.3 USING REFERENCES AND POINTERS WITH CONSTANTS
3.4 DYNAMIC MEMORY ALLOCATION
3.4.1 STATIC VERSUS DYNAMIC MEMORY ALLOCATION
3.4.2 DYNAMIC ARRAYS
3.5 CASE STUDY: LOTTERY RANDOM NUMBER GENERATOR
4 CLASSES AND OBJECTS
4.1 PROCEDURAL VERSUS OBJECT-ORIENTED PROGRAMMING
4.2 C++ STRUCTURES VERSUS C STRUCTURES
4.3 CLASSES
4.3.1 ACCESSING CLASS MEMBERS
4.3.2 MEMBER FUNCTIONS
4.3.3 ALLOCATING OBJECTS AT RUN-TIME
4.4 CONSTRUCTOR AND DESTRUCTOR FUNCTIONS
4.4.1 CONSTRUCTORS
4.4.2 THE CLASS DESTRUCTOR
4.5 CASE STUDY: DATA ENCRYPTION
5 CLASSES: ADVANCED TOPICS
5.1 PASSING TO AND RETURNING OBJECTS FROM FUNCTIONS
5.2 COPY CONSTRUCTOR
5.3 FRIEND FUNCTIONS AND CLASSES
5.3.1 FRIEND FUNCTIONS
5.3.2 FRIEND CLASSES
5.4 STATIC MEMBERS
5.4.1 STATIC DATA MEMBERS
5.4.2 STATIC MEMBER FUNCTIONS
5.5 THE this POINTER
5.6 CONSTANT MEMBER FUNCTIONS
6 OPERATOR OVERLOADING
6.1 FUNDAMENTALS OF OPERATOR OVERLOADING
6.2 OPERATOR FUNCTIONS
6.3 OVERLOADING BINARY OPERATORS
6.4 OVERLOADING UNARY OPERATORS
6.5 OVERLOADING THE STREAM OPERATORS
6.6 CASE STUDY: AC CURRENT CALCULATOR
7 INHERITANCE
7.1 FUNDAMENTALS OF INHERITANCE
7.2 THE protected ACCESS SPECIFIER
7.3 CONSTRUCTING AND DESTROYING DERIVED CLASSES
7.4 MULTIPLE INHERITANCE
7.4.1 DIRECT MULTIPLE INHERITANCE
7.4.2 INDIRECT MULTIPLE INHERITANCE
7.5 DOMINATING AND OVERRIDING BASECLASS MEMBERS
8 COMPOSITION
8.1 COMPOSITION VERSUS INHERITANCE
8.2 USING COMPOSITION
8.3 CONSTRUCTING AND DESTROYING COMPOSED CLASSES
8.4 COMBINING INHERITANCE AND COMPOSITION
8.5 CASE STUDY: COMPUTER SYSTEM CONFIGURATOR
9 POLYMORPHISM AND VIRTUAL FUNCTIONS
9.1 DYNAMIC VERSUS STATIC BINDING
9.2 VIRTUAL FUNCTIONS
9.3 ABSTRACT BASE CLASSES
9.4 VIRTUAL DESTRUCTORS
9.5 USING POLYMORPHISM
9.6 CASE STUDY: LOGIC CIRCUIT CALCULATOR
10 TEMPLATES
10.1 CLASS TEMPLATES
10.1.1 Template Parameters
10.1.2 Member Functions of Class Templates
10.1.3 Using Friends and Static Members with Class Templates
10.1.4 Using the void Pointer
10.2 TEMPLATES AND INHERITANCE
10.3 CONTAINERS AND ITERATORS
10.3.1 Sequence Containers
10.3.2 Associative Containers
10.3.3 Iterators
10.4 STANDARD TEMPLATE LIBRARY (STL)
11 EXCEPTION HANDLING
11.1 FUNDAMENTALS OF EXCEPTION HANDLING
11.2 USING try-throw-catch
11.2.1 Throwing and Handling an Exception
11.2.2 Exception Specifications
11.3 HANDLING MEMORY ALLOCATION ERRORS
11.4 EXCEPTIONS AND CLASSES
12 FILE I/O
12.1 STEPS IN FILE I/O PROCESSING
12.1.1 Creating a File Object
12.1.2 Opening a File
12.1.3 Using a File
12.1.4 Closing a File
12.2 SEQUENTIAL FILES
12.3 RANDOM-ACCESS FILES
APPENDIX A C++ KEYWORDS AND SYNONYMS
APPENDIX B C++ OPERATORS
APPENDIX C STANDARD C++ LIBRARY
APPENDIX D STANDARD C++ ALGORITHMS
APPENDIX E ANSWERS TO ODD-NUMBERED QUESTIONS
猜您喜欢