Book description
A Ready Reference for C++
C++ for the Impatient offers both the quickest way for busy programmers to learn the latest features of the C++ language and a handy resource for quickly finding answers to specific language questions. Designed to give you the most accurate and up-to-date information you require fast and to the point, this book is also an essential guide to the new C++11 standard, including advanced uses of the C++ standard library.
Features include
Concise descriptions of nearly every function, object, and operator in the C++ core language and standard library, with clear, well-chosen examples for each of them
Information provided “at a glance” through syntax displays, tables, and summaries of important functions
Content organized for quick look-up of needed information
Simple explanations of advanced concepts, using helpful illustrations
Complete program examples that are both useful and intriguing, including puzzles, games, and challenging exercises
C++11 features, all covered in the book, include:
Lambdas
rvalue references
Regular-expression library
Randomization library
Hash-table containers
Smart pointers
C++ for the Impatient is an ideal resource for anyone who needs to come up to speed quickly on C++11. Whether or not it’s your first C++ book, it will be one you come back to often for reliable answers.
Table of contents
- About This eBook
- Title Page
- Copyright Page
- Dedication Page
- Contents
- Preface
- Acknowledgments
- About the Author
-
Chapter 1. C++ Fundamentals
- 1.1. Elements of a C++ Program
- 1.2. Dealing with “Flashing Console”
- 1.3. Working with Microsoft Visual Studio
- 1.4. Doing More with C++
- 1.5. Adding Simple Variable Declarations
- 1.6. Introduction to C++ Control Structures
- 1.7. General Structure of a C++ Program
- 1.8. More about Namespaces
- 1.9. Some Comments about Comments
- 1.10. Sample App: Adding Machine
- Exercises
- 1.11. Sample App: Calculating Phi
- Exercises
-
Chapter 2. Data
- 2.1. Declaring Simple Variables
- 2.2. Primitive Data Types
- 2.3. Symbolic Names (“Symbols”)
- 2.4. Numeric Literals
- 2.5. Mixing Numeric Types
- 2.6. String and Character Literals
- 2.7. Data Declarations: The Complete Syntax
- 2.8. Enumerated Types
- 2.9. Special Declarations (typedef, auto, decltype)
- 2.10. Sample App: Type Promotion
- Exercises
- Chapter 3. Operators
-
Chapter 4. Control Structures
- 4.1. Concise Summary of C++ Statements
- 4.2. Null Statements (;) and Expression Statements
- 4.3. Compound Statements
- 4.4. if and if-else Statements
- 4.5. while and do-while Statements
- 4.6. for Statements
- 4.7. Range-based for Statements (C++11)
- 4.8. switch Statements
- 4.9. Jump Statements (break, continue, goto)
- 4.10. Exception Handling (try, catch)
- 4.11. Sample App: Guess-the-Number Game
- Exercises
- 4.12. Sample App: Computer Guesses the Number
- Exercises
-
Chapter 5. Functions
- 5.1. Overview of Traditional (Named) Functions
- 5.2. Local and Global Variables
- 5.3. Complete Function Declaration Syntax
- 5.4. Function Overloading
- 5.5. Arguments with Default Values
- 5.6. Variable-Length Argument Lists
- 5.7. Lambda, or Anonymous, Functions (C++11)
- 5.8. constexpr Functions (C++11)
- 5.9. Sample App: Odds at Dice
- Exercises
- Chapter 6. Pointers, Arrays, and References
- Chapter 7. Classes and Objects
- Chapter 8. Preprocessor Directives
- Chapter 9. Creating and Using Templates
- Chapter 10. C-String Library Functions
- Chapter 11. C I/O Library Functions
-
Chapter 12. Math, Time, and Other Library Functions
- 12.1. Trigonometric Functions
- 12.2. Other Math Functions
- 12.3. The C Date and Time Library
- 12.4. String-to-Number Conversions
- 12.5. Memory-Allocation Functions
- 12.6. Standard C Randomization Functions
- 12.7. Searching and Sorting Functions
- 12.8. Other Standard C Library Functions
- 12.9. Sample App: Idiot Savant
- Exercises
-
Chapter 13. C++ I/O Stream Classes
- 13.1. The Basics of C++ I/O Streams
- 13.2. Reading a Line of Input with getline
- 13.3. The C++ Stream-Class Hierarchy
- 13.4. Stream Objects: Manipulators and Flags
- 13.5. Stream Member Functions (General Purpose)
- 13.6. File Stream Operations
- 13.7. Reading and Writing String Streams
- 13.8. Overloading Shift Operators for Your Classes
- 13.9. Sample App: Text File Reader
- Exercises
- Chapter 14. The C++ STL String Class
- Chapter 15. Introduction to STL (vector, deque)
- Chapter 16. STL Sequence Containers (List)
- Chapter 17. STL Associated Containers (map, set)
- Chapter 18. STL Algorithms
- Chapter 19. C++11 Randomization Library
-
Chapter 20. C++11 Regular-Expression Library
- 20.1. Overview of C++11 Regular Expressions
- 20.2. Dealing with Escape Sequences (\)
- 20.3. Constructing a RegEx String
- 20.4. Matching and Searching Functions
- 20.5. “Find All,” or Iterative, Searches
- 20.6. Replacing Text
- 20.7. String Tokenizing
- 20.8. Catching RegEx Exceptions
- 20.9. Sample App: RPN Calculator
- Exercises
- Appendix A. A Painless Introduction to Rvalue References (C++11)
- Appendix B. Summary of New Features in C++11
- Appendix C. ASCII Codes
- Index
Product information
- Title: C++ for the Impatient
- Author(s):
- Release date: May 2013
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780133257120
You might also like
book
Effective Modern C++
Coming to grips with C++11 and C++14 is more than a matter of familiarizing yourself with …
book
C++ Crash Course
Upgrade your Code with C++ C++ is one of the most widely used languages for real-world …
book
C++ Concurrency in Action, Second Edition
This bestseller has been updated and revised to cover all the latest changes to C++ 14 …
book
C++ High Performance
Write code that scales across CPU registers, multi-core, and machine clusters About This Book Explore concurrent …