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

floating-point display precision, 1082–1083

flushing buffers, 1075–1076

formatting data types, 1076–1078

methods, 1071–1075

number base display, 1078–1079

printing trailing zeros/decimal points, 1083–1090

creating, 523

defined, 13, 36

functions. See function objects

ifstream, 1116–1119

ofstream, 1115–1119

ostringstream, 1142–1145

passing by reference, 770

passing by value, 770

pointers, 665–670

reference variables, 401–405

returning, 662–664, 770–771

const objects, 662–665

non-const objects, 663

stream, 1067

string, 965

subobjects, 797

this pointer, 539–546

valarray, 1045–1051

vector, 979–991, 1045–1051

adding elements to, 982–983

past-the-end iterators, 981–982

removing ranges of, 982

shuffling elements in, 987

sorting, 987

vect1.cpp example, 980–981

vect2.cpp sample program, 984–986

vect3.cpp sample program, 988–991

oct manipulators, 1078–1079, 1090–1091

octal numbers, 1215–1216

ofstream objects, 290, 1115–1119

one definition rule, 475

one-dimensional arrays, 244

OOP (object-oriented programming), 13, 506–507, 512, 1207

classes, 47–48

client/server model, 520

overview, 13–14

open namespaces, 485

open() method, 291–293, 967, 1119, 1122–1125

opening files, 1124–1125

multiple, 1119

operands, 97

operator functions, 565

operator overloading, 37, 564–566

addition operator (+), 569–572

cin object input, 1095–1097

example, 565–569

mytime0.cpp, 566

mytime0.h, 566

usetime0.cpp, 568–569

left shift operator (<), 581–587

member versus nonmember functions, 587–588

multiplication operator (*), 574–578

operator functions, 565

operator*(), 574–578

operator+(), 569–572

operator-(), 574–578

operator<<(), 581–585, 587

restrictions, 573–574

subtraction operator (-), 574–578

vector class, 588–590, 600

adding vectors, 590

declaring, 591–592

displacement vectors, 589

implementation comments, 602

member functions, 592, 597

multiple representations, 599

overloaded arithmetic operators, 599–600

overloading overloaded operators, 601

Random Walk sample program, 602, 605–606

state members, 597–599

with classes, string, 965

operator*() function, 574–578

operator+() function, 569–572

operator+() method, 1266

operator-() function, 574–578

operators, 1235

addition operator (+), overloading, 569–572

alternative tokens, 1222

arithmetic operators, 97–99

associativity, 99–100

division (/), 100–101

modulus (%), 101–102

order of precedence, 99–100

assignment (=), 43–44, 644, 767–768, 772–775

custom definitions, 645–646

enumerator value ranges, 153

enumerator values, setting, 152

overloading, 652–658

potental problems, 645

strings, 133–134

structures, 145–146

when to use, 644

associativity, 1231

examples, 1234

table of, 1232–1234

binary operators, 601, 1234

bitwise operators, 1235

alternative representations, 1240

logical bitwise operators, 1237–1240

shift operators, 1235–1237

testing bit values, 1241–1242

toggling, 1241

turning bits off, 1241

turning bits on, 1241

combination assignment operators, 211–212

comma, 214–217

example, 214–216

precedence, 217

concatenation (+), strings, 133–134

conditional (?::), 273–274

const_cast, 944

decrement (—), 207–208

pointers, 210–211

postfixing, 209–210

prefixing, 209–210

deferencing (*), pointers, 171–172

defined, 70

delete, 163–164, 180–183, 400, 454, 476–477, 668

dereferencing (*), 155–159

dynamic cast, 934–943

functor equivalents for arithmetic, logical, and relational operators, 1031–1032

increment (++), 197, 207–208

pointers, 210–211

postfixing, 209–210

prefixing, 209–210

left shift operator (<<)

overloading, 581–587, 676

literal operators, 1204

member dereferencing operators, 1242–1246

multiplication operator (*), overloading, 574–578

new, 180–182, 454, 476–482, 668

bad_alloc exceptions, 921

constructors, 659–661, 677–678

dynamic arrays, 164–167

dynamic structures, 178–180

free store, 183

memory allocation, 160–162

placement new, 671–676

reference variables, 400

operator functions, 565

operator*(), 574–578

operator+(), 569–572

operator-(), 574–578

operator<<(), 581–587

overloading, 101, 564–565

addition operator (+), 569–572

assignment operator, 652–658

example, 565–569

left shift operator (<<), 581–587, 676

member versus nonmember functions, 587–588

multiplication operator (*), 574–578

operator functions, 565

overloading overloaded operators, 601

restrictions, 573–574

subtraction operator (-), 574–578

precedence, 1231

examples, 1234

table of, 1232–1234

reference operator (&), 383–386

reinterpret_cast, 946

relational operators, 217–220

C-style strings, comparing, 220–223

equality operator (==), 218–220

string class strings, comparing, 223–224

table of, 217

scope resolution (::), 467

scope-resolution (::), 514

scope-resolution operator, 1332

sizeof, 71–73

static_cast, 945–946

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

Все книги серии 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.

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

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