SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
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.
· 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.
Download additional content associated with this title here.
Download errata here.
Be Smart About C++11 Smart Pointers
Exception Management in C++ and Python Development: Planning for the Unexpected
Formatting Your Output with C++ Streams
Put on Your Sorting Hat: Which Algorithm Makes Your Sort 500 Times Faster?
Regular Expressions 101: Regex in C++11
Regular Expressions 102: Text Translation in C++
The First Programs to Write in Any New Language
Warping Out with Hash-Table Containers in C++11
C++11 Regular-Expression Library
Download the sample pages (includes Chapter 20 and Index)
Preface xix
Acknowledgments xxvii
About the Author xxix
Chapter 1: C++ Fundamentals 1
1.1 Elements of a C++ Program 1
1.2 Dealing with “Flashing Console” 4
1.3 Working with Microsoft Visual Studio 5
1.4 Doing More with C++ 6
1.5 Adding Simple Variable Declarations 7
1.6 Introduction to C++ Control Structures 10
1.6.1 Making Decisions with “if” 11
1.6.2 Looping with “while” 13
1.7 General Structure of a C++ Program 14
1.8 More about Namespaces 15
1.9 Some Comments about Comments 17
1.9.1 C++ Comments (Line Comments) 17
1.9.2 C-Language-Style Comments 17
1.10 Sample App: Adding Machine 19
Exercises 20
1.11 Sample App: Calculating Phi 20
Exercises 23
Chapter 2: Data 25
2.1 Declaring Simple Variables 25
2.2 Primitive Data Types 27
2.3 Symbolic Names (“Symbols”) 30
2.4 Numeric Literals 31
2.5 Mixing Numeric Types 33
2.5.1 Integer versus Floating Point 34
2.5.2 bool versus Integer Types 34
2.5.3 Signed versus Unsigned Integers 35
2.6 String and Character Literals 39
2.6.1 Single-Quoted Characters 39
2.6.2 Double-Quoted Strings 40
2.6.3 Special Characters (Escape Sequences) 41
2.6.4 Wide-Character Strings 45
2.6.5 Raw String Literals (C++11) 46
2.7 Data Declarations: The Complete Syntax 46
2.8 Enumerated Types 50
2.9 Special Declarations (typedef, auto, decltype) 52
2.9.1 The typedef Keyword 52
2.9.2 The auto and decltype Keywords (C++11) 53
2.10 Sample App: Type Promotion 54
Exercises 55
Chapter 3: Operators 57
3.1 Precedence, Associativity, and Lvalues 57
3.2 Concise Summary of Operators 59
3.3 Operators in Detail 62
3.4 The Great Controversy: Postfix or Prefix? 77
3.5 Bitwise Operators in Detail 78
3.6 Cast Operators 82
Exercises 90
Chapter 4: Control Structures 91
4.1 Concise Summary of C++ Statements 91
4.2 Null Statements (;) and Expression Statements 93
4.3 Compound Statements 94
4.4 if and if-else Statements 96
4.5 while and do-while Statements 98
4.6 for Statements 99
4.7 Range-based for Statements (C++11) 101
4.8 switch Statements 103
4.9 Jump Statements (break, continue, goto) 104