Читаем C++ Primer Plus полностью

12 Classes and Dynamic Memory Allocation

13 Class Inheritance

14 Reusing Code in C++

15 Friends, Exceptions, and More

16 The string Class and the Standard Template Library

17 Input, Output, and Files

18 Visiting with the New C++ Standard

Appendixes

A Number Bases

B C++ Reserved Words

C The ASCII Character Set

D Operator Precedence

E Other Operators

F The string Template Class

G The Standard Template Library Methods and Functions

H Selected Readings and Internet Resources

I Converting to ISO Standard C++

J Answers to Chapter Reviews

Index

Table of Contents

Introduction

1 Getting Started with C++

Learning C++: What Lies Before You

The Origins of C++: A Little History

Portability and Standards

The Mechanics of Creating a Program

Summary

2 Setting Out to C++

C++ Initiation

C++ Statements

More C++ Statements

Functions

Summary

Chapter Review

Programming Exercises

3 Dealing with Data

Simple Variables

The const Qualifier

Floating-Point Numbers

C++ Arithmetic Operators

Summary

Chapter Review

Programming Exercises

4 Compound Types

Introducing Arrays

Strings

Introducing the string Class

Introducing Structures

Unions

Enumerations

Pointers and the Free Store

Pointers, Arrays, and Pointer Arithmetic

Combinations of Types

Array Alternatives

Summary

Chapter Review

Programming Exercises

5 Loops and Relational Expressions

Introducing for Loops

The while Loop

The do while Loop

The Range-Based for Loop (C++11)

Loops and Text Input

Nested Loops and Two-Dimensional Arrays

Summary

Chapter Review

Programming Exercises

6 Branching Statements and Logical Operators

The if Statement

Logical Expressions

The cctype Library of Character Functions

The ?: Operator

The switch Statement

The break and continue Statements

Number-Reading Loops

Simple File Input/Output

Summary

Chapter Review

Programming Exercises

7 Functions: C++’s Programming Modules

Function Review

Function Arguments and Passing by Value

Functions and Arrays

Functions and Two-Dimensional Arrays

Functions and C-Style Strings

Functions and Structures

Functions and string Class Objects

Functions and array Objects

Recursion

Pointers to Functions

Summary

Chapter Review

Programming Exercises

8 Adventures in Functions

C++ Inline Functions

Reference Variables

Default Arguments

Function Overloading

Function Templates

Summary

Chapter Review

Programming Exercises

9 Memory Models and Namespaces

Separate Compilation

Storage Duration, Scope, and Linkage

Namespaces

Summary

Chapter Review

Programming Exercises

10 Objects and Classes

Procedural and Object-Oriented Programming

Abstraction and Classes

Class Constructors and Destructors

Knowing Your Objects: The this Pointer

An Array of Objects

Class Scope

Abstract Data Types

Summary

Chapter Review

Programming Exercises

11 Working with Classes

Operator Overloading

Time on Our Hands: Developing an Operator Overloading Example

Introducing Friends

Overloaded Operators: Member Versus Nonmember Functions

More Overloading: A Vector Class

Automatic Conversions and Type Casts for Classes

Summary

Chapter Review

Programming Exercises

12 Classes and Dynamic Memory Allocation

Dynamic Memory and Classes

The New, Improved String Class

Things to Remember When Using new in Constructors

Observations About Returning Objects

Using Pointers to Objects

Reviewing Techniques

A Queue Simulation

Summary

Chapter Review

Programming Exercises

13 Class Inheritance

Beginning with a Simple Base Class

Inheritance: An Is-a Relationship

Polymorphic Public Inheritance

Static and Dynamic Binding

Access Control: protected

Abstract Base Classes

Inheritance and Dynamic Memory Allocation

Class Design Review

Summary

Chapter Review

Programming Exercises

14 Reusing Code in C++

Classes with Object Members

Private Inheritance

Multiple Inheritance

Class Templates

Summary

Chapter Review

Programming Exercises

15 Friends, Exceptions, and More

Friends

Nested Classes

Exceptions

Runtime Type Identification

Type Cast Operators

Summary

Chapter Review

Programming Exercises

16 The string Class and the Standard Template Library

The string Class

Smart Pointer Template Classes

The Standard Template Library

Generic Programming

Function Objects (a.k.a. Functors)

Algorithms

Перейти на страницу:

Все книги серии Developer's Library

C++ Primer Plus
C++ Primer Plus

C++ Primer Plus is a carefully crafted, complete tutorial on one of the most significant and widely used programming languages today. An accessible and easy-to-use self-study guide, this book is appropriate for both serious students of programming as well as developers already proficient in other languages.The sixth edition of C++ Primer Plus has been updated and expanded to cover the latest developments in C++, including a detailed look at the new C++11 standard.Author and educator Stephen Prata has created an introduction to C++ that is instructive, clear, and insightful. Fundamental programming concepts are explained along with details of the C++ language. Many short, practical examples illustrate just one or two concepts at a time, encouraging readers to master new topics by immediately putting them to use.Review questions and programming exercises at the end of each chapter help readers zero in on the most critical information and digest the most difficult concepts.In C++ Primer Plus, you'll find depth, breadth, and a variety of teaching techniques and tools to enhance your learning:• A new detailed chapter on the changes and additional capabilities introduced in the C++11 standard• Complete, integrated discussion of both basic C language and additional C++ features• Clear guidance about when and why to use a feature• Hands-on learning with concise and simple examples that develop your understanding a concept or two at a time• Hundreds of practical sample programs• Review questions and programming exercises at the end of each chapter to test your understanding• Coverage of generic C++ gives you the greatest possible flexibility• Teaches the ISO standard, including discussions of templates, the Standard Template Library, the string class, exceptions, RTTI, and namespaces

Стивен Прата

Программирование, программы, базы данных

Похожие книги

1С: Бухгалтерия 8 с нуля
1С: Бухгалтерия 8 с нуля

Книга содержит полное описание приемов и методов работы с программой 1С:Бухгалтерия 8. Рассматривается автоматизация всех основных участков бухгалтерии: учет наличных и безналичных денежных средств, основных средств и НМА, прихода и расхода товарно-материальных ценностей, зарплаты, производства. Описано, как вводить исходные данные, заполнять справочники и каталоги, работать с первичными документами, проводить их по учету, формировать разнообразные отчеты, выводить данные на печать, настраивать программу и использовать ее сервисные функции. Каждый урок содержит подробное описание рассматриваемой темы с детальным разбором и иллюстрированием всех этапов.Для широкого круга пользователей.

Алексей Анатольевич Гладкий

Программирование, программы, базы данных / Программное обеспечение / Бухучет и аудит / Финансы и бизнес / Книги по IT / Словари и Энциклопедии
1С: Управление торговлей 8.2
1С: Управление торговлей 8.2

Современные торговые предприятия предлагают своим клиентам широчайший ассортимент товаров, который исчисляется тысячами и десятками тысяч наименований. Причем многие позиции могут реализовываться на разных условиях: предоплата, отсрочка платежи, скидка, наценка, объем партии, и т.д. Клиенты зачастую делятся на категории – VIP-клиент, обычный клиент, постоянный клиент, мелкооптовый клиент, и т.д. Товарные позиции могут комплектоваться и разукомплектовываться, многие товары подлежат обязательной сертификации и гигиеническим исследованиям, некондиционные позиции необходимо списывать, на складах периодически должна проводиться инвентаризация, каждая компания должна иметь свою маркетинговую политику и т.д., вообщем – современное торговое предприятие представляет живой организм, находящийся в постоянном движении.Очевидно, что вся эта кипучая деятельность требует автоматизации. Для решения этой задачи существуют специальные программные средства, и в этой книге мы познакомим вам с самым популярным продуктом, предназначенным для автоматизации деятельности торгового предприятия – «1С Управление торговлей», которое реализовано на новейшей технологической платформе версии 1С 8.2.

Алексей Анатольевич Гладкий

Финансы / Программирование, программы, базы данных