商品描述
Beginning C++ is a tutorial for beginners in C++ and discusses a subset of C++ that is suitable for beginners. The language syntax corresponds to the C++14 standard. This book is environment neutral and does not presume any specific operating system or program development system. There is no assumption of prior programming knowledge.
All language concepts that are explained in the book are illustrated with working program examples. Most chapters include exercises for you to test your knowledge. Code downloads are provided for examples from the text and solutions to the exercises and there is an additional download for a more substantial project for you to try when you have finished the book.
This book introduces the elements of the C++ standard library that provide essential support for the language syntax that is discussed. While the Standard Template Library (STL) is not discussed to a significant extent, a few elements from the STL that are important to the notion of modern C++ are introduced and applied.
Beginning C++ is based on and supersedes Ivor Horton’s previous book, Beginning ANSI C++.
What youll learn
- How to work with fundamental C++ data types and do calculations
- How to build logic into a program using loops, choices, decisions and more
- How to work with arrays, vectors, and strings
- How to use raw pointers and smart pointers
- How to program with functions and deal with program files and pre-processing directives
- How to define your own data types using classes and class operations
- How to implement operator overloading for your own data types
- How to apply class inheritance and use virtual functions to obtain polymorphism and errors/exception handling
- How to signal and handle errors using exceptions
- How to define and use function templates and class templates
- How to do file input and output with C++
Who this book is for
This book is for industry practitioners and students wanting to learn C++ and use this as a reference guide for their applications.
Table of Contents
Chapter 1: Basic IdeasChapter 2: Introducing Fundamental Types of Data
Chapter 3: Working Fundamental Types
Chapter 4: Making Decisions
Chapter 5: Arrays and Loops
Chapter 6: Pointers and References
Chapter 7: Working with Strings
Chapter 8: Defining Functions
Chapter 9: Lambda Expressions
Chapter 10: Preprocessor directives
Chapter 11: Defining your own Data Types
Chapter 12: Operator Overloading
Chapter 13: Inheritance
Chapter 14: Virtual Functions and Polymorphism
Chapter 15: Runtime Errors and Exceptions
Chapter 16: Class Templates
Chapter 17: File Input and Output
商品描述(中文翻譯)
《初學 C++》是一本針對 C++ 初學者的教程,討論適合初學者的 C++ 子集。語言語法符合 C++14 標準。本書不針對特定的作業系統或程式開發系統,並且不假設讀者具備任何先前的程式設計知識。
書中解釋的所有語言概念均以可運行的程式範例進行說明。大多數章節包含練習題,讓您測試自己的知識。書中提供了範例的程式碼下載以及練習題的解答,並且還有一個額外的下載,供您在完成本書後嘗試一個更具規模的專案。
本書介紹了 C++ 標準庫的元素,這些元素為所討論的語言語法提供了基本支持。雖然標準模板庫(Standard Template Library, STL)並未深入討論,但介紹並應用了幾個與現代 C++ 概念相關的重要 STL 元素。
《初學 C++》基於 Ivor Horton 之前的書籍《初學 ANSI C++》並對其進行了更新。
您將學到什麼
- 如何使用基本的 C++ 數據類型進行計算
- 如何使用迴圈、選擇、決策等將邏輯構建到程式中
- 如何使用陣列、向量和字串
- 如何使用原始指標和智能指標
- 如何使用函數進行程式設計,並處理程式檔案和預處理指令
- 如何使用類別和類別操作定義自己的數據類型
- 如何為自己的數據類型實現運算子重載
- 如何應用類別繼承並使用虛擬函數以獲得多型性和錯誤/例外處理
- 如何使用例外來信號和處理錯誤
- 如何定義和使用函數模板和類別模板
- 如何使用 C++ 進行檔案的輸入和輸出
本書適合誰
本書適合希望學習 C++ 的業界從業人員和學生,並將其作為應用的參考指南。
目錄
第 1 章:基本概念
第 2 章:介紹基本數據類型
第 3 章:操作基本類型
第 4 章:做出決策
第 5 章:陣列和迴圈
第 6 章:指標和引用
第 7 章:操作字串
第 8 章:定義函數
第 9 章:Lambda 表達式
第 10 章:預處理指令
第 11 章:定義自己的數據類型
第 12 章:運算子重載
第 13 章:繼承
第 14 章:虛擬函數和多型性
第 15 章:執行時錯誤和例外
第 16 章:類別模板
第 17 章:檔案輸入和輸出