use_ptr() method, 1244

use_sales.cpp, 925–927

use_stuc.cpp, 795–797

use_stui.cpp, 804–805

use_tv.cpp, 882

USHRT_MAX constant, 72

using-declaration, 491

using directive, 35–36, 59–60

using keyword, 486–490, 807–808, 1332

V

valarray class, 786–787, 1045–1046, 1049–1051

templates, 1162

value, passing by, 313–314, 770

value_comp() method, 1282

value_compare type, 1281, 1284

value_type type, 1273

values

assigning to pointers, 171

indirect, 155

valvect.cpp, 1048

variable arrays, 1329

variables, 66

assigning values to, 43

automatic, 182, 453–457

example, 455–457

initializing, 458

stacks, 458–459

automatic variables, 314

declaring, 41–43

dynamic, 454

dynamic memory, 476–479, 482

enum, 150–152

enumerators, 150–151

value ranges, 153

values, setting, 152

floating-point numbers, 92

advantages/disadvantages, 96–97

constants, 96

decimal-point notation, 92

double data type, 94–96

E notation, 92–93

float data type, 94–96

long double data type, 94–96

global, compared to local variables, 467

indeterminate values, 73

initializing, 52, 73

integers, 68

bool, 90

char, 80–89

choosing integer types, 76–77

climits header file, 71–73

constants, 78–80, 90–92

initializing, 73

int, 68–70

long, 68–70

short, 68–70

sizeof operator, 71–73

unsigned, 74–76

width of, 68

keywords, static, 183

local variables, 314–315

compared to global variables, 467

naming conventions, 66–68

pointers, 153

assigning values to, 171

C++ philosophy, 155

cautions, 159

compared to pointed-to values, 172

declaring, 155–159, 171

deferencing, 171–172

delete operator, 163–164

example, 154

initializing, 157–159

integers, 160

new operator, 160–162

pointer arithmetic, 167–172

pointer notation, 173

strings, 173–178

reference variables, 383

arguments, 408–409

class objects, 401–405

creating, 383–386

function parameters, 386, 389–390

inheritance, 405–408

properties, 390–391

structures, 394, 397–401

scope, 454

global, 454

local, 454–457

namespace, 454

static, 453, 459–462

external, 466

external linkage, 463, 466–467

internal linkage, 467–470

no linkage, 470–472

temporary variables, 392–394

type conversions, 102

in arguments, 106

in expressions, 105–106

on assignment, 103–104

type casts, 107–109

variadic templates, 866, 1197

recursion, 1199–1202

template and function parameter packs, 1197–1198

unpacking the packs, 1198–1199

variadic2.cpp, 1201

variations on function pointers, 365–370

vect.cpp, 593

vect.h, 591

vect1.cpp, 980

vect2.cpp, 984–985

vect3.cpp, 988

vector class, 588–590, 600, 979–988, 991, 1045–1046, 1049–1051

adding elements to, 982–983

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

past-the-end iterators, 981–982

Random Walk sample program, 602, 605–606

removing ranges of, 982

shuffling elements in, 987

sorting, 987

state members, 597–599

vect1.cpp example, 980–981

vect2.cpp sample program, 984–986

vect3.cpp sample program, 988–991

vector class templates, 1012–1013

vector containers, 1012–1013

vector objects versus arrays, 188–189

vector template class, 120, 186–187

vectors, methods, 1278–1280

vegnews.cpp, 634

versatility of templates, 845–846

version1() function, 403

version2() function, 404

version3() function, 405

ViewAcct() function, 725–726, 730

virtual base classes, 815–817

combining with nonvirtual base classes, 828

constructors, 817–818

dominance, 828–829

methods, 818–828

virtual destructors, 737, 742–743, 776

virtual function tables (vtbl), 740

virtual functions, 739–742, 775–776

behavior, 734–736

friends, 743, 776

memory and execution speed, 742

pure virtual functions, 748

redefinition, 743–745

virtual function tables, 740

virtual keyword, 742

virtual methods, 1183–1184

void functions, 307

void statement, 53

volatile keyword, 473

vslice.cpp, 1049–1050

vtbl (virtual function table), 740

W

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

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

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