Book description
Sams Teach Yourself C++ in One Hour a Day
Jesse Liberty
Siddhartha Rao
Bradley Jones
The Sixth Edition of Sams Teach Yourself C++ in 21 Days
More than 250,000 sold!
In just one hour a day, you’ll have all the skills you need to begin programming in C++. With this complete tutorial, you’ll quickly master the basics and then move on to more advanced features and concepts:
Master the fundamentals of C++ and object-oriented programming
Learn some of the more advanced features of C++
Learn the Standard Template Library and the containers and algorithms used in most real-world C++ applications
Learn how to build effective programs in C++ with hands-on exercises
Get expert tips on implementing C++ in the corporate environment
Learn on your own time, at your own pace
No previous programming experience required
Learn C++ and object-oriented design, programming, and analysis
Write fast and powerful C++ programs, compile the source code, and create executable files
Understand the latest ANSI standard
Use the Standard Template Library’s algorithms and containers to write feature-rich yet stable C++ applications
Develop sophisticated programming techniques with functions, arrays, variables, and smart pointers
Learn to expand your program’s power with inheritance and polymorphism
Master the features of C++ by learning from programming experts
Works with all ANSI C++ compilers
Jesse Liberty is the author of numerous books on software development, including best-selling titles on C++ and .NET. He is the president of Liberty Associates, Inc., where he provides custom programming, consulting, and training.
Siddhartha Rao, Microsoft MVP for Visual C++, has experience in programming driver and application software using C++. He is an expert in the Windows programming arena and works for a German software giant. He also moderates CodeGuru.com, a vibrant online programming community.
Bradley Jones, Microsoft MVP for Visual C++, runs a number of software development sites including Developer.com, CodeGuru.com, DevX, VBForums, Gamelan, and other JupiterWeb-owned sites.
Category: Programming
Covers: C++
User Level: Beginning–Intermediate
Register your book at informit.com/register for access to source code, example files, updates, and corrections as they become available.
Table of contents
- Copyright
- Lead Author, Sixth Edition
- Contributing Authors
- Acknowledgments
- We Want to Hear from You!
- Reader Services
- Introduction
-
I. The Basics
-
1. Getting Started
- A Brief History of C++
- How C++ Evolved
- Should I Learn C First?
- Microsoft’s Managed Extensions to C++
- The ANSI Standard
- Preparing to Program
- Your Development Environment
- The Process of Creating the Program
- The Development Cycle
- HELLO.cpp—Your First C++ Program
- Getting Started with Your Compiler
- Compile Errors
- Summary
- Q&A
- Workshop
- 2. The Anatomy of a C++ Program
-
3. Using Variables, Declaring Constants
- What Is a Variable?
- Defining a Variable
- Determining Memory Consumed by a Variable Type
- Creating More Than One Variable at a Time
- Assigning Values to Your Variables
- Creating Aliases with typedef
- When to Use short and When to Use long
- Working with Characters
- Constants
- Enumerated Constants
- Summary
- Q&A
- Workshop
- 4. Managing Arrays and Strings
-
5. Working with Expressions, Statements, and Operators
- Starting with Statements
- Expressions
- Working with Operators
- Combining the Assignment and Mathematical Operators
- Incrementing and Decrementing
- Understanding Operator Precedence
- Nesting Parentheses
- The Nature of Truth
- The if Statement
- Using Braces in Nested if Statements
- Using the Logical Operators
- Short Circuit Evaluation
- Relational Precedence
- More About Truth and Falsehood
- The Conditional (Ternary) Operator
- Summary
- Q&A
- Workshop
-
6. Organizing Code with Functions
- What Is a Function?
- Return Values, Parameters, and Arguments
- Declaring and Defining Functions
- Execution of Functions
- Determining Variable Scope
- Parameters Are Local Variables
- Considerations for Creating Function Statements
- More About Function Arguments
- More About Return Values
- Default Parameters
- Overloading Functions
- Special Topics About Functions
- How Functions Work—A Peek Under the Hood
- Summary
- Q&A
- Workshop
- 7. Controlling Program Flow
-
8. Pointers Explained
-
What Is a Pointer?
- A Bit About Memory
- Getting a Variable’s Memory Address
- Storing a Variable’s Address in a Pointer
- Pointer Names
- Getting the Value from a Variable
- Dereferencing with the Indirection Operator
- Pointers, Addresses, and Variables
- Manipulating Data by Using Pointers
- Examining the Address
- Pointers and Array Names
- A Pointer to an Array Versus an Array of Pointers
- Why Would You Use Pointers?
- The Stack and the Free Store (Heap)
- Another Look at Memory Leaks
- Creating Objects on the Free Store
- Deleting Objects from the Free Store
- Stray, Wild, or Dangling Pointers
- Using const Pointers
- Summary
- Q&A
- Workshop
-
What Is a Pointer?
-
9. Exploiting References
- What Is a Reference?
- Using the Address-Of Operator (&) on References
- Null Pointers and Null References
- Passing Function Arguments by Reference
- Returning Multiple Values
- Passing by Reference for Efficiency
- Knowing When to Use References Versus Pointers
- Mixing References and Pointers
- Returning Out-of-Scope Object References
- Summary
- Q&A
- Workshop
-
1. Getting Started
-
II. Fundamentals of Object-Oriented Programming and C++
-
10. Classes and Objects
- Is C++ Object-Oriented?
- Creating New Types
- Introducing Classes and Members
- Accessing Class Members
- Private Versus Public Access
- Implementing Class Methods
- Adding Constructors and Destructors
- Including const Member Functions
- Where to Put Class Declarations and Method Definitions
- Inline Implementation
- Classes with Other Classes as Member Data
- Exploring Structures
- Summary
- Q&A
- Workshop
- 11. Implementing Inheritance
- 12. Polymorphism
- 13. Operator Types and Operator Overloading
- 14. Casting Operators
-
15. An Introduction to Macros and Templates
- The Preprocessor and the Compiler
- The #define Preprocessor Directive
- Macro Functions
-
An Introduction to Templates
- Template Declaration Syntax
- The Different Types of Template Declarations
- Template Classes
- Template Instantiation and Specialization
- Template and Type Safety
- Declaring Templates with Multiple Parameters
- Declaring Templates with Default Parameters
- A Template Sample
- Using Templates in Practical C++ Programming
- Summary
- Q&A
- Workshop
-
10. Classes and Objects
-
III. Learning the Standard Template Library (STL)
- 16. An Introduction to the Standard Template Library
- 17. The STL string Class
- 18. STL Dynamic Array Classes
- 19. STL list
- 20. STL set and multiset
- 21. STL map and multimap
-
IV. More STL
- 22. Understanding Function Objects
-
23. STL Algorithms
- What Are STL Algorithms?
- Classification of STL Algorithms
-
Usage of STL Algorithms
- Counting and Finding Elements
- Searching for an Element or a Range in a Collection
- Initializing Elements in a Container to a Specific Value
- Processing Elements in a Range Using for_each
- Performing Transformations on a Range Using std::transform
- Copy and Remove Operations
- Replacing Values and Replacing Element Given a Condition
- Sorting and Searching in a Sorted Collection, and Erasing Duplicates
- Partitioning a Range
- Inserting Elements in a Sorted Collection
- Summary
- Q&A
- Workshop
- 24. Adaptive Containers: stack and queue
- 25. Working with Bit Flags Using STL
-
V. Advanced C++ Concepts
- 26. Understanding Smart Pointers
- 27. Working with Streams
- 28. Exception Handling
- 29. Tapping Further into the Preprocessor
-
Appendixes
- A. Working with Numbers: Binary and Hexadecimal
- B. C++ Keywords
- C. Operator Precedence
-
D. Answers
- Lesson 1, “Getting Started”
- Lesson 2, “The Anatomy of a C++ Program”
- Lesson 3, “Using Variables, Declaring Constants”
- Lesson 4, “Managing Arrays and Strings”
- Lesson 5, “Working with Expressions, Statements, and Operators”
- Lesson 6, “Organizing Code with Functions”
- Lesson 7, “Controlling Program Flow”
- Lesson 8, “Pointers Explained”
- Lesson 9, “Exploiting References”
- Lesson 10, “Classes and Objects”
- Lesson 11, “Implementing Inheritance”
- Lesson 12, “Polymorphism”
- Lesson 13, “Operator Types and Operator Overloading”
- Lesson 14, “Casting Operators”
- Lesson 15, “An Introduction to Macros and Templates”
- Lesson 16, “An Introduction to the Standard Template Library”
- Lesson 17, “The STL string Class”
- Lesson 18, “STL Dynamic Array Classes”
- Lesson 19, “STL list”
- Lesson 20, “STL set and multiset”
- Lesson 21, “STL map and multimap”
- Lesson 22, “Understanding Function Objects”
- Lesson 23, “STL Algorithms”
- Lesson 24, “Adaptive Containers: stack and queue”
- Lesson 25, “Working with Bit Flags Using STL”
- Lesson 26, “Understanding Smart Pointers”
- Lesson 27, “Working with Streams”
- Lesson 28, “Exception Handling”
- Lesson 29, “Tapping Further into the Preprocessor”
- Inside Back Cover
Product information
- Title: Sams Teach Yourself C++ in One Hour a Day, Sixth Edition
- Author(s):
- Release date: July 2008
- Publisher(s): Sams
- ISBN: 9780768678598
You might also like
book
Sams Teach Yourself C++ in One Hour a Day, Eighth Edition
In just one hour a day, you’ll have all the skills you need to begin programming …
book
Sams Teach Yourself C++ in 24 Hours, Sixth Edition
Sams Teach Yourself C++ in 24 Hours is a hands-on guide to the C++ programming language. …
book
Sams Teach Yourself C++ in One Hour a Day, 9th Edition
The Ninth Edition of Sams Teach Yourself C++ in One Hour a Day Starting with one …
book
Beginning Programming with C++ For Dummies, 2nd Edition
Learn to program with C++ quickly with this helpful For Dummies guide Beginning Programming with C++ …