C++ Without Fear : A Beginner's Guide That Makes You Feel Smart
暫譯: 無懼 C++:讓你感覺聰明的初學者指南

Brian Overland

  • 出版商: Prentice Hall
  • 出版日期: 2004-09-24
  • 定價: $1,150
  • 售價: 3.5$399
  • 語言: 英文
  • 頁數: 486
  • 裝訂: Paperback
  • ISBN: 0321246950
  • ISBN-13: 9780321246950
  • 相關分類: C++ 程式語言
  • 立即出貨(限量) (庫存=2)

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

商品描述

Table of Contents:

Preface.

    Why a New C++ Book?

    What Else Is New about This Book?

    Multiple Learning Paths:What Fits You Best.

    What If You Already Have a Programming Background?

    What Is Not Covered?

    Why Should Anyone Start with C++?

    To Get Started.

    Tips and Tricks: What Do I Watch Out For?

Acknowledgments.

1. Your First C++ Programs.

    Thinking like a Programmer.

    What's Different about C++?

    Building a C++ Program.

    Installing Your Own C++ Compiler.

    Example 1.1. Print a Message.

    Advancing to the Next Print Line.

    Example 1.2. Print Multiple Lines.

    Storing Data: C++ Variables.

    Introduction to Data Types.

    Example 1.3. Convert Temperatures.

    A Word about Variable Names and Keywords.

    Chapter 1 Summary.

2. Decisions, Decisions.

    But First, a Few Words about Data Types.

    Decision Making in Programs.

    If and if-else.

    Example 2.1. Odd or Even?

    Introducing Loops.

    Example 2.2. Print 1 to N.

    True and False in C++.

    The Increment Operator (++).

    Statements vs. Expressions.

    Introducing Boolean (Short-Circuit) Logic.

    Example 2.3. Testing a Person's Age.

    Introducing the Math Library.

    Example 2.4. Prime-Number Test.

    Chapter 2 Summary.

3. The Handy, All-Purpose "for" Statement.

    Loops Used for Counting.

    Introducing the "for" Loop.

    A Wealth of Examples.

    Example 3.1. Printing 1 to N with "for".

    Statement Blocks with "for".

    Declaring Loop Variables on the Fly.

    Example 3.2. Prime-Number Test with "for".

    Comparative Languages 101: The Basic "for" Statement.

    Chapter 3 Summary.

4. Functions: Many Are Called.

    The Concept of Function.

    Function Calls and the Flow of the Program.

    The Basics of Using Functions.

    Example 4.1. Triangle-Number Function.

    Example 4.2. Prime-Number Function.

    Local and Global Variables.

    Recursive Functions.

    Example 4.3. Greatest Common Factor (GCF).

    Example 4.4. Prime Factorization.

    Example 4.5. Random-Number Generator.

    Chapter 4 Summary.

5. Arrays: We've Got Their Number.

    A First Look at C++ Arrays.

    Initializing Arrays.

    Zero-Based Indexing.

    Example 5.1. Print Out Elements.

    Example 5.2.How Random Is Random?

    Strings and Arrays of Strings.

    Example 5.3. Card Dealer #1.

    Example 5.4. Card Dealer #2.

    Example 5.5. Card Dealer#3.

    A Word to the Wise.

    2-D Arrays: Into the Matrix.

    Chapter 5 Summary.

6. Pointers: Getting a Handle on Data.

    The Concept of Pointer.

    Declaring and Using Pointers.

    Example 6.1. The Double-It Function.

    Swap: Another Function Using Pointers.

    Example 6.2.Array Sorter.

    Pointer Arithmetic.

    Pointers and Array Processing.

    Example 6.3. Zero Out an Array.

    Chapter 6 Summary.

7. Strings: Analyzing the Text.

    Text Storage on the Computer.

    It Don't Mean a Thing If It Ain't Got That String.

    String-Manipulation Functions.

    Example 7.1. Building Strings.

    Reading String Input.

    Example 7.2. Get a Number.

    Example 7.3. Convert to Uppercase.

    Individual Characters vs. Strings.

    Example 7.4.Analyze Input.

    The New C++ String Class.

    Example 7.5. Building Strings with the string Type.

    Other Operations on the string Type.

    Chapter 7 Summary.

8. Files: Electronic Storage.

    Introducing File-Stream Objects.

    How to Refer to Disk Files.

    Example 8.1.Write Text to a File.

    Example 8.2. Display a Text File.

    Text Files vs. "Binary" Files.

    Introducing Binary Operations.

    Example 8.3. Random-Access Write.

    Example 8.4. Random-Access Read.

    Chapter 8 Summary.

9. Some Advanced Programming Techniques.

    Command-Line Arguments.

    Example 9.1. Display File from Command Line.

    Function Overloading.

    Example 9.2. Printing Different Types of Arrays.

    The do-while Loop.

    The switch-case Statement.

    Multiple Modules.

    Exception Handling.

    Example 9.3. Exception Handling with GCF.

    Chapter 9 Summary.

10. Getting Yourself Object Oriented.

    Why Get Object Oriented?

    A String Parser.

    Objects vs. Classes.

    Another Example: The Fraction Class.

    Object Creation and Destruction.

    Inheritance, or Subclassing.

    Creating Shared Interfaces.

    Polymorphism: True Object Independence.

    Polymorphism and Virtual Functions.

    What about Reusability?

    Chapter 10 Summary.

11. The Fraction Class.

    Point: A Simple Class.

    Private:Members Only (Protecting the Data).

    Example 11.1. Testing the Point Class.

    Introducing the Fraction Class.

    Inline Functions.

    Find the Greatest Common Factor.

    Find the Lowest Common Multiple.

    Example 11.2. Fraction Support Functions.

    Example 11.3. Testing the Fraction Class.

    Example 11.4. Fraction Arithmetic: add and mult.

    Chapter 11 Summary.

12. Constructors: If You Build It….

    Introducing Constructors.

    Multiple Constructors (Overloading).

    The Default Constructor…and a Warning.

    Example 12.1. Point Class Constructors.

    Example 12.2. Fraction Class Constructors.

    Reference Variables and Arguments (&).

    The Copy Constructor.

    Example 12.3. Fraction Class Copy Constructor.

    Chapter 12 Summary.

13. Operator Functions: Doing It with Class.

    Introducing Class Operator Functions.

    Operator Functions As Global Functions.

    Improve Efficiency with References.

    Example 13.1. Point Class Operators.

    Example 13.2. Fraction Class Operators.

    Working with Other Types.

    The Class Assignment Function (=).

    The Test-for-Equality Function (==).

    A Class "Print" Function.

    Example 13.3. The Completed Fraction Class.

    Chapter 13 Summary.

14. What's "new": The StringParser Class.

    The "new"Operator.

    Objects and "new".

    Allocating Array Data.

    Example 14.1. Dynamic Memory in Action.

    Design for a Parser (Lexical Analyzer).

    Example 14.2. The StringParser Class.

    Chapter 14 Summary.

15. What's "this": The String Class.

    Introducing the String Class.

    Introducing Class Destructors.

    Example 15.1. A Simple String Class.

    "Deep" Copying and the Copy Constructor.

    The "this" Keyword.

    Revisiting the Assignment Operator.

    Writing a Concatenation Function.

    Example 15.2. The Complete String Class.

    Chapter 15 Summary.

16. Inheritance: What a Legacy.

    Subclassing for Fun and Profit.

    Example 16.1. The FloatFraction Class.

    Problems with the FloatFraction Class.

    Example 16.2. The Completed FloatFraction Class.

    Example 16.3. The ProperFraction Class.

    Private and Protected Members.

    Example 16.4. Contained Members: FractionUnits.

    Chapter 16 Summary.

17. Polymorphism: Object Independence.

    A Different Approach to the FloatFraction Class.

    Virtual Functions to the Rescue!

    Example 17.1. The Revised FloatFraction Class.

    "Pure Virtual" and Other Arcane Matters.

    Abstract Classes and Interfaces.

    Why cout Is Not Truly Polymorphic.

    Example 17.2. True Polymorphism: The Printable Class.

    A Final Word (or Two).

    A Final Final Word.

    Chapter 17 Summary.

Appendix A. C++ Operators.

Appendix B. Intrinsic Data Types.

Appendix C. C++ Syntax Summary.

Appendix D. ASCII Codes.

Appendix E. Common Library Functions.

Appendix F. Glossary of Terms.

Index.

商品描述(中文翻譯)

目錄:

前言。
    為什麼要寫一本新的 C++ 書籍?
    這本書還有什麼新內容?
    多條學習路徑:哪一條最適合你?
    如果你已經有程式設計背景怎麼辦?
    什麼內容沒有涵蓋?
    為什麼任何人都應該從 C++ 開始?
    開始之前。
    提示與技巧:我需要注意什麼?

致謝。
1. 你的第一個 C++ 程式。
    像程式設計師一樣思考。
    C++ 有什麼不同?
    建立一個 C++ 程式。
    安裝你自己的 C++ 編譯器。
    範例 1.1. 輸出一條訊息。
    進入下一行輸出。
    範例 1.2. 輸出多行。
    儲存資料:C++ 變數。
    資料類型簡介。
    範例 1.3. 轉換溫度。
    關於變數名稱和關鍵字的說明。
    第 1 章總結。

2. 決策,決策。
    但首先,關於資料類型的幾句話。
    程式中的決策制定。
    if 和 if-else。
    範例 2.1. 奇數或偶數?
    介紹迴圈。
    範例 2.2. 輸出 1 到 N。
    C++ 中的真與假。
    增量運算子 (++)。
    陳述式與表達式。
    介紹布林(短路)邏輯。
    範例 2.3. 測試一個人的年齡。
    介紹數學函式庫。
    範例 2.4. 質數測試。
    第 2 章總結。

3. 實用的全能 'for' 陳述式。
    用於計數的迴圈。
    介紹 'for' 迴圈。
    豐富的範例。
    範例 3.1. 使用 'for' 輸出 1 到 N。
    使用 'for' 的陳述式區塊。
    即時宣告迴圈變數。
    範例 3.2. 使用 'for' 的質數測試。
    比較語言 101:基本的 'for' 陳述式。
    第 3 章總結。

4. 函式:許多人被呼叫。
    函式的概念。
    函式呼叫與程式流程。
    使用函式的基本知識。
    範例 4.1. 三角數函式。
    範例 4.2. 質數函式。
    區域變數與全域變數。
    遞迴函式。
    範例 4.3. 最大公因數 (GCF)。
    範例 4.4. 質因數分解。
    範例 4.5. 隨機數生成器。
    第 4 章總結。

5. 陣列:我們知道它們的數量。
    C++ 陣列的初步了解。
    陣列的初始化。
    零基索引。
    範例 5.1. 輸出元素。
    範例 5.2. 隨機性有多隨機?
    字串與字串陣列。
    範例 5.3. 發牌者 #1。
    範例 5.4. 發牌者 #2。
    範例 5.5. 發牌者 #3。
    給明智者的一句話。
    2-D 陣列:進入矩陣。
    第 5 章總結。

6. 指標:掌握資料。
    指標的概念。
    宣告與使用指標。
    範例 6.1. 雙倍函式。
    交換:另一個使用指標的函式。
    範例 6.2. 陣列排序器。
    指標運算。
    指標與陣列處理。
    範例 6.3. 將陣列歸零。
    第 6 章總結。

7. 字串:分析文本。
    電腦上的文本儲存。
    如果沒有字串就沒有意義。
    字串操作函式。
    範例 7.1. 建立字串。
    讀取字串輸入。
    範例 7.2. 獲取數字。
    範例 7.3. 轉換為大寫。
    單個字元與字串。
    範例 7.4. 分析輸入。
    新的 C++ 字串類別。
    範例 7.5. 使用字串類型建立字串。
    對字串類型的其他操作。
    第 7 章總結。

8. 檔案:電子儲存。