E-Book, Englisch, 771 Seiten
Horton / Weert Beginning C++17
5th ed
ISBN: 978-1-4842-3366-5
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
From Novice to Professional
E-Book, Englisch, 771 Seiten
Reihe: Professional and Applied Computing
ISBN: 978-1-4842-3366-5
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
- Define variables and make decisions
- Work with arrays and loops, pointers and references, strings, and more
- Write your own functions, types, and operators
- Discover the essentials of object-oriented programming
- Use overloading, inheritance, virtual functions and polymorphism
- Write generic function templates and class templates
- Get up to date with modern C++ features: auto type declarations, move semantics, lambda expressions, and more
- Examine the new additions to C++17
Autoren/Hrsg.
Weitere Infos & Material
1;Contents;5
2;About the Authors;22
3;About the Technical Reviewer;23
4;Introduction;24
5;Chapter 1: Basic Ideas;26
5.1;Modern C++;26
5.2;Standard Libraries;27
5.3;C++ Program Concepts;28
5.3.1;Source Files and Header Files;28
5.3.2;Comments and Whitespace;29
5.3.3;Preprocessing Directives and Standard Library Headers;29
5.3.4;Functions;30
5.3.5;Statements;30
5.3.6;Data Input and Output;31
5.3.7;return Statements;32
5.3.8;Namespaces;32
5.3.9;Names and Keywords;33
5.4;Classes and Objects;34
5.5;Templates;34
5.6;Code Appearance and Programming Style;34
5.7;Creating an Executable;35
5.8;Procedural and Object-Oriented Programming;37
5.9;Representing Numbers;38
5.9.1;Binary Numbers;38
5.9.2;Hexadecimal Numbers;39
5.9.3;Negative Binary Numbers;41
5.9.4;Octal Values;42
5.9.5;Bi-Endian and Little-Endian Systems;43
5.9.6;Floating-Point Numbers;44
5.10;Representing Characters;45
5.10.1;ASCII Codes;46
5.10.2;UCS and Unicode;46
5.11;C++ Source Characters;47
5.11.1;Escape Sequences;47
5.12;Summary;49
6;Chapter 2: Introducing Fundamental Types of Data;51
6.1;Variables, Data, and Data Types;51
6.1.1;Defining Integer Variables;52
6.1.1.1;Signed Integer Types;54
6.1.1.2;Unsigned Integer Types;55
6.1.2;Zero Initialization;56
6.1.3;Defining Variables with Fixed Values;56
6.2;Integer Literals;57
6.2.1;Decimal Integer Literals;57
6.2.2;Hexadecimal Literals;58
6.2.3;Octal Literals;58
6.2.4;Binary Literals;59
6.3;Calculations with Integers;59
6.3.1;Compound Arithmetic Expressions;60
6.4;Assignment Operations;61
6.4.1;The op= Assignment Operators;64
6.5;The sizeof Operator;66
6.6;Incrementing and Decrementing Integers;66
6.6.1;Postfix Increment and Decrement Operations;67
6.7;Defining Floating-Point Variables;68
6.8;Floating-Point Literals;69
6.9;Floating-Point Calculations;70
6.9.1;Pitfalls;70
6.9.2;Invalid Floating-Point Results;71
6.9.3;Mathematical Functions;72
6.10;Formatting Stream Output;75
6.11;Mixed Expressions and Type Conversion;77
6.12;Explicit Type Conversion;78
6.12.1;Old-Style Casts;80
6.13;Finding the Limits;81
6.13.1;Finding Other Properties of Fundamental Types;82
6.14;Working with Character Variables;83
6.14.1;Working with Unicode Characters;84
6.15;The auto Keyword;85
6.16;Summary;86
7;Chapter 3: Working with Fundamental Data Types;89
7.1;Operator Precedence and Associativity;89
7.2;Bitwise Operators;91
7.2.1;The Bitwise Shift Operators;92
7.2.1.1;Shifting Signed Integers;94
7.2.2;Logical Operations on Bit Patterns;95
7.2.2.1;Using the Bitwise AND;95
7.2.2.2;Using the Bitwise OR;96
7.2.2.3;Using the Bitwise Complement Operator;97
7.2.2.4;Using the Bitwise Exclusive OR;98
7.2.2.5;Using the Bitwise Operators: An Example;99
7.3;Enumerated Data Types;101
7.4;Aliases for Data Types;104
7.5;The Lifetime of a Variable;105
7.6;Global Variables;106
7.7;Summary;109
8;Chapter 4: Making Decisions;112
8.1;Comparing Data Values;112
8.1.1;Applying the Comparison Operators;113
8.1.2;Comparing Floating-Point Values;115
8.2;The if Statement;115
8.2.1;Nested if Statements;119
8.2.2;Character Classification and Conversion;120
8.3;The if-else Statement;122
8.3.1;Nested if-else Statements;124
8.3.2;Understanding Nested ifs;125
8.4;Logical Operators;126
8.4.1;Logical AND;127
8.4.2;Logical OR;127
8.4.3;Logical Negation;128
8.4.4;Combining Logical Operators;128
8.4.5;Logical Operators on Integer Operands;130
8.4.6;Logical Operators vs. Bitwise Operators;131
8.4.6.1;Short-Circuit Evaluation;131
8.4.6.2;Logical XOR;132
8.5;The Conditional Operator;133
8.6;The switch Statement;135
8.6.1;Fallthrough;139
8.7;Statement Blocks and Variable Scope;141
8.7.1;Initialization Statements;142
8.8;Summary;143
9;Chapter 5: Arrays and Loops;146
9.1;Arrays;146
9.1.1;Using an Array;146
9.2;Understanding Loops;148
9.3;The for Loop;149
9.4;Avoiding Magic Numbers;151
9.5;Defining the Array Size with the Braced Initializer;153
9.6;Determining the Size of an Array;153
9.7;Controlling a for Loop with Floating-Point Values;155
9.8;More Complex for Loop Control Expressions;158
9.8.1;The Comma Operator;159
9.9;The Range-Based for Loop;160
9.10;The while Loop;161
9.11;The do-while Loop;163
9.12;Nested Loops;165
9.13;Skipping Loop Iterations;168
9.14;Breaking Out of a Loop;169
9.14.1;Indefinite Loops;169
9.15;Controlling a for Loop with Unsigned Integers;173
9.16;Arrays of Characters;175
9.17;Multidimensional Arrays;178
9.17.1;Initializing Multidimensional Arrays;181
9.17.1.1;Setting Dimensions by Default;182
9.17.2;Multidimensional Character Arrays;183
9.18;Allocating an Array at Runtime;184
9.19;Alternatives to Using an Array;187
9.19.1;Using array




