
Practical C++ Programming
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Table of Contents
- Preface
- Scope of This Handbook
- How This Book Is Organized
- How to Read This Book If You Already Know C
- Font Conventions
- How to Contact Us
- Acknowledgments for the First Edition
- Acknowledgments for the Second Edition
- Part I
- What Is C++?
- A Brief History of C++
- C++ Organization
- How to Learn C++
- The Basics of Program Writing
- Programs from Conception to Execution
- Creating a Real Program
- Creating a Program Using a Command-Line Compiler
- Step 1: Create a place for your program
- Step 2: Create the program
- Step 3: Run the compiler
- Step 4: Execute the program
- Creating a Program Using an Integrated Development Environment
- Borland C++
- Microsoft Visual C++
- Getting Help in Unix
- Getting Help in an IDE
- Programming Exercises
- Style
- Comments
- C++ Code
- Naming Style
- Coding Religion
- Indentation and Code Format
- Clarity
- Simplicity
- Consistency and Organization
- Further Reading
- Summary
- Basic Declarations and Expressions
- Basic Program Structure
- Simple Expressions
- The std::cout Output Object
- Variables and Storage
- Variable Declarations
- Integers
- Assignment Statements
- Floating-Point Numbers
- Floating-Point Divide Versus Integer Divide
- Characters
- Wide Characters
- Boolean Type
- Programming Exercises
- Answers to Chapter Questions
- Arrays, Qualifiers, and Reading Numbers
- Arrays
- Strings
- Wide Strings
- Reading Data
- Initializing Variables
- Bounds Errors
- Multidimensional Arrays
- C-Style Strings
- Safety and C Strings
- Reading C-Style Strings
- Converting Between C-Style and C++ Strings
- The Differences Between C++ and C-Style Strings
- Types of Integers
- Summary of Integer Types
- Types of Floats
- Constant and Reference Declarations
- Qualifiers
- Special
- Constant
- Storage Class
- Size
- Sign
- Type
- Hexadecimal and Octal Constants
- Operators for Performing Shortcuts
- Side Effects
- Programming Exercises
- Answers to Chapter Questions
- Decision and Control Statements
- if Statement
- else Statement
- How Not to Use std::strcmp
- Looping Statements
- while Statement
- break Statement
- continue Statement
- The Assignment Anywhere Side Effect
- Programming Exercises
- Answers to Chapter Questions
- The Programming Process
- Setting Up Your Work Area
- The Specification
- Code Design
- The Prototype
- The Makefile
- Testing
- Debugging
- Maintenance
- Revisions
- Electronic Archaeology
- Mark Up the Program
- Use the Debugger
- Use the Text Editor as a Browser
- Add Comments
- Programming Exercises
- Part II
- More Control Statements
- for Statement
- switch Statement
- switch, break, and continue
- Programming Exercises
- Answers to Chapter Questions
- Variable Scope and Functions
- Scope and Storage Class
- The for Scope
- Namespaces
- Namespace std
- Global Namespace
- File-Specific Namespace
- Nested Namespaces
- The using Statement
- The problem with the using statement
- Functions
- Returning void
- Namespaces and Functions
- const Parameters and Return Values
- Reference Parameters and Return Values
- Dangling References
- Array Parameters
- Function Overloading
- Default Arguments
- Unused Parameters
- Inline Functions
- Summary of Parameter Types
- Recursion
- Structured Programming Basics
- Real-World Programming
- Programming Exercises
- Answers to Chapter Questions
- The C++ Preprocessor
- #define Statement
- #define Versus const
- Conditional Compilation
- #include Files
- Parameterized Macros
- The # Operator
- Parameterized Macros Versus Inline Functions
- Advanced Features
- Summary
- Programming Exercises
- Answers to Chapter Questions
- Bit Operations
- Bit Operators
- The AND Operator (&)
- Bitwise OR (|)
- The Bitwise Exclusive OR (^)
- The Ones Complement Operator (NOT) (~)
- The Left and Right Shift Operators (&&, &&)
- Right Shift Details
- Setting, Clearing, and Testing Bits
- Bitmapped Graphics
- Programming Exercises
- Answers to Chapter Questions
- Part III
- Advanced Types
- Structures
- Unions
- typedef
- enum Type
- Bit Members or Packed Structures
- Arrays of Structures
- Programming Exercises
- Answers to Chapter Questions
- Simple Classes
- Stacks
- Designing a Stack
- Improved Stack
- Using a Class
- Introduction to Constructors and Destructors
- Destructors
- Parameterized Constructors
- Parameterized Destructors
- Copy Constructor
- Automatically Generated Member Functions
- Automatically Generated and Used Functions
- Explicit Constructors
- Shortcuts
- Style
- Structures Versus Classes
- Programming Exercises
- More on Classes
- Friends
- Friend Functions
- Friend Classes
- Constant Functions
- Constant Members
- Static Member Variables
- Static Member Functions
- The Meaning of static
- Programming Exercises
- Simple Pointers
- const Pointers
- Pointers and Printing
- Pointers and Arrays
- Splitting a C-Style String
- The reinterpret_cast
- Pointers and Structures
- Command-Line Arguments
- Programming Exercises
- Answers to Chapter Questions
- Part IV
- File Input/Output
- C++ File I/O
- Reading C-Style Strings
- Output Files
- Conversion Routines
- Binary and ASCII Files
- The End-of-Line Puzzle
- Binary I/O
- Buffering Problems
- Unbuffered I/O
- Designing File Formats
- C-Style I/O Routines
- C-Style Conversion Routines
- The std::printf Family of Output Functions
- The std::scanf Family of Input Functions
- C-Style Binary I/O
- C- Versus C++- Style I/O
- Simplicity
- Reliability
- Speed
- Which Should You Use?
- Programming Exercises
- Answers to Chapter Questions
- Debugging and Optimization
- Code Reviews
- Planning the Review
- The Review Meeting
- Why People Don't Do Code Reviews
- Metrics
- Serial Debugging
- Divide and Conquer
- The Confessional Method of Debugging
- Debug-Only Code
- Debug Command-Line Switch
- Going Through the Output
- Interactive Debuggers
- Basic Debugging Commands
- Debugging a Simple Program
- Debugging a Binary Search
- The First Bug, a Segmentation Fault
- The Unintended Infinite Loop
- Interactive Debugging Tips and Tricks
- Runtime Errors
- Optimization
- Profiling
- Analyzing and Optimizing code
- Register Declarations
- Loop ordering
- The power of powers of 2
- Making use of pointers
- Using the System Library
- How to Optimize
- Case Study: Inline Functions Versus Normal Functions
- Case Study: Optimizing a Color-Rendering Algorithm
- Programming Exercises
- Answers to Chapter Questions
- Operator Overloading
- Creating a Simple Fixed-Point Class
- Fixed Point Basics
- Creating the fixed_pt Class
- Operator Functions
- Binary Arithmetic Operators
- Relational Operators
- Unary Operators
- Shortcut Operators
- Increment and Decrement Operators
- Logical Operators
- I/O Operators
- Index Operator "[ ]"
- new and delete
- Exotic Operators
- Operator Member Functions
- Casting
- Warts
- Full Definition of the Fixed-Point Class
- Programming Exercises
- Answers to Chapter Questions
- Floating Point
- Floating-Point Format
- Floating Addition/Subtraction
- Multiplication and Division
- Overflow and Underflow
- Roundoff Error
- Accuracy
- Minimizing Roundoff Error
- Determining Accuracy
- Precision and Speed
- Power Series
- Programming Exercises
- Advanced Pointers
- Pointers, Structures, and Classes
- delete Operator
- Linked Lists
- Ordered Linked Lists
- Doubly Linked Lists
- Trees
- Printing a Tree
- The Rest of the Program
- Data Structures for a Chess Program
- Programming Exercises
- Answers to Chapter Questions
- Advanced Classes
- Derived Classes
- Virtual Functions
- Virtual Classes
- Function Hiding in Derived Classes
- Constructors and Destructors in Derived Classes
- The dynamic_cast Operator
- Summary
- Programming Exercises
- Answers to Chapter Questions
- Part V
- Exceptions
- Adding Exceptions to the Stack Class
- Creating an Exception
- Using a Try Block for Normal Execution
- Throwing an Exception
- Exceptions and Destructors
- Exceptions Versus assert
- Programming Exercises
- Modular Programming
- Modules
- Public and Private
- The extern Storage Class
- Headers
- The Body of the Module
- A Program to Use Infinite Arrays
- The Makefile for Multiple Files
- Using the Infinite Array
- Dividing a Task into Modules
- Module Design Guidelines
- Programming Exercises
- Templates
- What Is a Template?
- Templates: The Hard Way
- Templates: The C++ Way
- Function Specialization
- Class Templates
- Class Specialization
- Implementation Details
- Real-World Templates
- When to Generate Code
- Writing Portable Templates
- Advanced Features
- Default Parameters
- Partial Specialization
- Summary
- Programming Exercises
- Standard Template Library
- STL Basics
- Containers
- Iterators
- Algorithms
- Class List-A Set of Students
- Iterating Through a Set
- Using std::foreach to Write Out the Set
- Multisets
- Creating a Waiting List with the STL List
- Storing Grades in a STL Map
- Putting It All Together
- Practical Considerations When Using the STL
- Getting the Types Right
- Error Messages
- Getting More Information
- Exercises
- Program Design
- Design Goals
- Design Factors
- Design Principles
- Coding
- Procedure Design
- Procedure interface
- Global variables
- Information hiding
- Coding details
- Modules and Structured Programming
- Interconnections
- Real-Life Module Organization
- Module Summary
- Objects
- Interfaces and C++ Classes
- Real-World Design Techniques
- The Linked List Problem
- Callbacks
- Decoupling the Interface and Implementation
- Conclusion
- Putting It All Together
- Requirements
- Code Design
- Token Module
- Character-Type Module
- Statistics Class
- Coding
- Functional Description
- char_type Class
- input_file Class
- token Class
- stat Class
- line_counter Class
- brace_counter Class
- paren_counter Class
- comment_counter Class
- do_file Procedure
- Testing
- Revisions
- A Final Warning
- Program Files
- Programming Exercises
- From C to C++
- K&R-Style Functions
- Prototypes
- struct
- malloc and free
- The C malloc function
- The C free function
- Turning Structures into Classes
- setjmp and longjmp
- Mixing C and C++ Code
- Summary
- Programming Exercise
- C++'s Dustier Corners
- do/while
- goto
- The ?: Construct
- The Comma Operator
- Overloading the ( ) Operator
- Pointers to Members
- The asm Statement
- The mutable Qualifier
- Run Time Type Identification
- Trigraphs
- Answers to Chapter Questions
- Programming Adages
- General
- Design
- Declarations
- switch Statement
- Preprocessor
- Style
- Compiling
- The Ten Commandments for C++ Programmers
- Final Note
- Answers to Chapter Questions
- Part VI
- ASCII Table
- Ranges
- Operator Precedence Rules
- Standard Rules
- Practical Subset of the Operator Precedence Rules
- Computing Sine Using a Power Series
- Resources
- Compilers
- Standard Template Library
- Standards
- Programming Tools
- Index
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.