Sams Teach Yourself C++ in 24 Hours, Complete Starter Kit, 3/e
暫譯: Sams 24小時自學C++ 完整入門套件 第3版

Jesse Liberty

  • 出版商: SAMS
  • 出版日期: 2001-08-24
  • 售價: $1,290
  • 貴賓價: 9.5$1,226
  • 語言: 英文
  • 頁數: 482
  • 裝訂: Paperback
  • ISBN: 0672322242
  • ISBN-13: 9780672322242
  • 相關分類: C++ 程式語言
  • 已絕版

買這商品的人也買了...

商品描述

Sams Teach Yourself C++ in 24 Hours, Third Edition extends to the beginning C++ programmer the promise of a solid and thorough tutorial broken down into consistent, manageable lessons of one hour each. The readers can master the core concepts and techniques of C++ programming at their own pace. The book covers all the basics, from introducing C++ syntax to developing C++ classes to introductory OOP concepts in a non-threatening, positive approach.

Table of Contents

Introduction.

I. INTRODUCING C++.

Hour 1—Getting Started.

Preparing to Program. C++, ANSI C++, ISO C++, Windows, and Other. Areas of Confusion. Installing and Setting Up the Compiler. Compiling and Linking the Source Code. The Development Cycle. HELLO.CPP—Your First C++ Program. Compile Errors.


Hour 2—The Parts of a C++ Program.

Why C++ Is the Right Choice. The Parts of a Simple Program. Comments. Functions.
Hour 3—Variables and Constants.
What Is a Variable? Defining a Variable. Creating More Than One Variable at a Time. Assigning Values to Your Variables. Typedef. When to Use short and When to Use long. Constants. Enumerated Constants.
Hour 4—Expressions and Statements.
Statements. Expressions. Operators. Combining the Assignment and Mathematical Operators. Increment and Decrement. Precedence. Nesting Parentheses. The Nature of Truth. Relational Operators. The if Statement. Use Braces in Nested if Statements. Logical Operators. Relational Precedence. More About Truth and Falsehood.
Hour 5—Functions.
What Is a Function? Declaring and Defining Functions. Local Variables. Global Variables. Function Statements. Function Arguments. Parameters Are Local Variables. Return Values. Default Parameters. Overloading Functions.
Hour 6—Program Flow.
Looping. while Loops. do...while Loops. for Loops. switch Statements.

II. CLASSES.

Hour 7—Basic Classes.
What Is a Type? Creating New Types. Classes and Members. Accessing Class Members. Private Versus Public. Implementing Class Methods. Constructors and Destructors.
Hour 8—More About Classes.
const Member Functions. Interface Versus Implementation. Where to Put Class Declarations and Method Definitions. Inline Implementation. Classes with Other Classes as Member Data.

III. MEMORY MANAGEMENT.

Hour 9<107>Pointers.
What Is a Pointer? Why Would You Use Pointers? The Stack and the Heap.
Hour 10—Advanced Pointers.
Creating Objects on the Heap. Deleting Objects. Accessing Data. Members Using Pointers. Member Data on the Heap. The this Pointer. What's the this Pointer For? Stray or Dangling Pointers. const Pointers.
Hour 11—References.
What Is a Reference? Creating a Reference. Using the Address of Operator on References. What Can Be Referenced? Null Pointers and Null References. Passing Function Arguments by Reference. Understanding Function Headers and Prototypes. Returning Multiple Values.
Hour 12—Advanced References and Pointers.
Passing by Reference for Efficiency. References as an Alternative to Pointers. When to Use References and When to Use Pointers. Don't Return a Reference to an Object That Isn't in Scope! Returning a Reference to an Object on the Heap. Pointer, Pointer, Who Has the Pointer?

IV. POWER TOOLS.

Hour 13—Advanced Functions.
Overloaded Member Functions. Using Default Values. Choosing Between Default Values and Overloaded Functions. Overloading Constructors. Initializing Objects. The Copy Constructor.
Hour 14—Operator Overloading.
Operator Overloading. Conversion Operators.
Hour 15—Arrays.
What Is an Array? Array Elements. Writing Past the End of an Array. Fence Post Errors. Initializing Arrays. Arrays of Objects. Multidimensional Arrays. A Word About Memory. Arrays of Pointers. Declaring Arrays on the Heap. A Pointer to an Array Versus an Array of Pointers. Pointers and Array Names. Deleting Arrays on the Heap. char Arrays. strcpy() and strncpy(). String Classes.

V. INHERITANCE AND POLYMORPHISM.

Hour 16—Inheritance.
What Is Inheritance? Private Versus Protected. Constructors and Destructors. Overriding Functions.
Hour 17—Polymorphism and Derived Classes.
Polymorphism Implemented With Virtual Methods.
Hour 18—Advanced Polymorphism.
Problems with Single Inheritance. Abstract Data Types.
Hour 19—Linked Lists.
Linked Lists and Other Structures. A Case Study. The Component Parts. What Have You Learned, Dorothy?

VI. SPECIAL TOPICS.

Hour 20—Special Classes, Functions, and Pointers.
Static Member Data. Static Member Functions. Containment. Friend Classes. Friend Functions. Pointers to Functions. Pointers to Member Functions.
Hour 21—The Preprocessor.
The Preprocessor and the Compiler. Seeing the Intermediate Form. Using #define. Inclusion and Inclusion Guards. Macro Functions. String Manipulation. Predefined Macros.
Hour 22—Object-Oriented Analysis and Design.
The Development Cycle. Simulating an Alarm System. PostMaster: A Case Study.
Hour 23—Templates.
What Are Templates? Parameterized Types. Template Definition. Using Template Items. The Standard Template Library.
Hour 24—Exceptions and Error Handling.
Bugs, Errors, Mistakes, and Code Rot. Exceptions. Using try Blocks and catch Blocks. Next Steps. Style. Next Steps.

VII. APPENDICES.

Appendix A. Binary and Hexadecimal.
Appendix B. Glossary.
Index.

商品描述(中文翻譯)

《Sams Teach Yourself C++ in 24 Hours, Third Edition》為初學者提供了一個穩固且全面的教學,分為每小時一個一致且可管理的課程。讀者可以按照自己的步調掌握 C++ 程式設計的核心概念和技術。本書涵蓋所有基礎知識,從介紹 C++ 語法到開發 C++ 類別,再到以非威脅性、正面的方式介紹物件導向程式設計(OOP)概念。

目錄

引言。

I. 介紹 C++。
小時 1—開始使用。
準備程式設計。C++、ANSI C++、ISO C++、Windows 及其他混淆區域。安裝和設置編譯器。編譯和鏈接源代碼。開發週期。HELLO.CPP—你的第一個 C++ 程式。編譯錯誤。

小時 2—C++ 程式的組成部分。
為什麼選擇 C++。簡單程式的組成部分。註解。函數。

小時 3—變數和常數。
什麼是變數?定義變數。一次創建多個變數。為變數賦值。Typedef。何時使用 short,何時使用 long。常數。列舉常數。

小時 4—表達式和語句。
語句。表達式。運算符。結合賦值運算符和數學運算符。遞增和遞減。優先級。嵌套括號。真理的本質。關係運算符。if 語句。在嵌套 if 語句中使用大括號。邏輯運算符。關係優先級。更多關於真與假的內容。

小時 5—函數。
什麼是函數?聲明和定義函數。局部變數。全域變數。函數語句。函數參數。參數是局部變數。返回值。預設參數。函數重載。

小時 6—程式流程。
循環。while 循環。do...while 循環。for 循環。switch 語句。

II. 類別。
小時 7—基本類別。
什麼是類型?創建新類型。類別和成員。訪問類別成員。私有與公有。實現類別方法。建構函數和解構函數。

小時 8—更多關於類別的內容。
const 成員函數。介面與實現。類別聲明和方法定義的位置。內聯實現。類別中包含其他類別作為成員數據。

III. 記憶體管理。
小時 9—指標。
什麼是指標?為什麼要使用指標?堆疊和堆。

小時 10—進階指標。
在堆上創建物件。刪除物件。訪問數據。使用指標的成員。堆上的成員數據。this 指標。this 指標的用途。懸空或懸掛指標。const 指標。

小時 11—引用。
什麼是引用?創建引用。在引用上使用地址運算符。可以引用什麼?空指標和空引用。通過引用傳遞函數參數。理解函數頭和原型。返回多個值。

小時 12—進階引用和指標。
為了效率而通過引用傳遞。引用作為指標的替代品。何時使用引用,何時使用指標。不要返回不在範圍內的物件的引用!返回堆上物件的引用。指標,指標,誰擁有指標?

IV. 強大工具。
小時 13—進階函數。
重載成員函數。使用預設值。在預設值和重載函數之間選擇。重載建構函數。初始化物件。複製建構函數。

小時 14—運算符重載。
運算符重載。轉換運算符。

小時 15—陣列。
什麼是陣列?陣列元素。寫入陣列末尾以外的內容。圍欄錯誤。初始化陣列。物件的陣列。多維陣列。關於記憶體的一句話。指標的陣列。在堆上聲明陣列。指向陣列的指標與指標的陣列。指標和陣列名稱。在堆上刪除陣列。char 陣列。strcpy() 和 strncpy()。字串類別。

V. 繼承和多型。
小時 16—繼承。
什麼是繼承?私有與保護。建構函數和解構函數。覆寫函數。

小時 17—多型和衍生類別。
使用虛擬方法實現多型。

小時 18—進階多型。
單一繼承的問題。抽象數據類型。

小時 19—鏈結串列。
鏈結串列和其他結構。案例研究。組成部分。你學到了什麼,Dorothy?

VI. 特殊主題。
小時 20—特殊類別、函數和指標。
靜態成員數據。靜態成員函數。包含。友元類別。友元函數。指向函數的指標。指向成員函數的指標。

小時 21—預處理器。
預處理器和編譯器。查看中間形式。使用 #define。包含和包含保護。宏函數。字串操作。預定義宏。

小時 22—物件導向分析與設計。
開發週期。模擬警報系統。PostMaster:案例研究。

小時 23—模板。
什麼是模板?參數化類型。模板定義。使用模板項目。標準模板庫。

小時 24—例外和錯誤處理。
錯誤、錯誤、失誤和代碼腐爛。例外。使用 try 區塊和 catch 區塊。下一步。風格。下一步。

VII. 附錄。
附錄 A. 二進位和十六進位。
附錄 B. 詞彙表。
索引。