Вы находитесь на странице: 1из 819

C++ 21

Microsoft Visual C++.


.
,

Microsoft Visual Studio.
6.0 -
, MFC
, .
- .

.
,
.

21
1.
23
1.
24
2. C++
40
3.
51
4.
71
5.
100
6.
135
7.
167
2.
201
8.
202
9.
233
10.
264
11.
301
12.
333
13.
374
14.
413
3.
451
15.
452
16.
505
17.
544
18. - 561
19.
596
20.
644
21.
673
.
725

. C++
.
.

1



1.

C++


, -

C++ -
C++

C++ Java
ANSI





C++ HELLO.
Visual C++ 6

2. ++
C++
cout

727
728
736
807
21
21
21
23
23
23
24
24
24
25
25
26
28
29
29
29
30
30
31
31
32
33
33
36
36
37
37
38
38
38
39
40
40
42
44
44


: !

3.










typedef
short long



#deiine
const

4.

45
45
46
47
49
49
49
49
50
51
51
52
52
53
54
55
56
57
57
58
59
60
61
61
62
63
63
64
64
64
65
65
66
68
68
69
70
70
71
71
72
72
72







if

else
if
if







5.

,







;

,

74
74
74
75
77
77
78
80
80
81
82
83
86
86
88
90
92
93
93
93
93
94
95
95
97
97
98
98
98
100
100
101
101
102
102
104
106
106
108
109
110
111





,


inline-

6.








,
,


,



,
,
- const


, -

112
112
113
114
116
119
121
122
123
128
128
129
131
132
132
133
133
134
135
135
136
136
136
137
138
138
138
138
139
139
142
143
145
147
148
148
151
152
155
156
159

7.

goto
goto
while
while
break continue
while(true)
do...while
do...while
for
for
for

- for

switch
switch

2


8.




,

,

162
163
163
164
165
165
165
167
167
167
168
169
170
171
173
174
175
176
178
181
182
183
184
186
189
192
192
192
193
193
201
201
202
202
204
206
206
207
208
209
211
211

new
delete





this
,
const
const
-
const this

9.

(&)




swap()
swap()






,

,
!

?

212
213
215
215
216
217
218
221
222
225
226
227
228
230
231
231
231
231
233
233
234
236
237
239
239
241
242
243
244
246
247
250
253
255
256
257
259
261
261
262
262

10.
-
,

,


-





this









11.










262
263
264
264
266
269
269
269
271
272
276
277
278
280
281
283
284
284
286
288
290
290
290
291
293
296
297
298
299
299
299
301
301
302
303
303
305
307
309
313
315
317
319


,


-

12.
















strcpy() strncpy()






13.

323
324
324
326
327
330
330
331
331
331
332
333
333
333
335
338
338
340
341
343
344
345
346
347
348
348
350
351
353
354
360
361
361
362
371
371
372
372
373
373
373
374
374





,

,





-






,
Java

14.
-
-




typedef
-
-

377
377
380
380
383
384
386
387
391
394
395
396
399
401
404
408
408
409
410
410
411
411
411
413
413
418
420
423
426
429
431
433
436
438
438
439
439
439
451


15.

16.

cin

,
>> istream
cin


cout

- cout
,
cout.width()


printf()

ofstream

451
452
452
458
458
459
462
465
466
475
483
492
492
497
501
502
502
502
503
505
505
505
506
509
509
509
510
511
512
514
515
515
517
522
522
522
524
524
525
526
528
531
531


-
ofstream

-

17.








using
using
using


std

18. -

C++ -

:

532
532
533
536
538
541
541
542
542
543
544
544
545
548
549
550
550
550
551
553
553
555
557
557
558
559
560
560
560
561
561
562
563
565
566
567
567
568
569
570
573
574



CRC


19.








,




576
577
577
578
578
579
579
581
581
582
583
585
589
592
594
594
595
595
595
596
596
597
597
597
599
599
602
603
603
607
610
615
620
624
624
625
625
631
633
633
634
634
634

20.
, , ""

""


try catch

catch








21.


#define
#define
#define
#else

637
638
639
640
641
641
642
642
642
644
644
645
646
646
647
652
652
652
655
658
665
668
668
669
669
669
669
670
670
671
671
671
673
673
674
674
674
674
675
676
678
678
680


assert()
assert()
assert()





(AND)
(OR)
(OR)







switch





assert()
const

680
682
682
682
683
683
685
685
686
686
691
693
699
699
699
700
700
700
700
701
701
704
704
705
705
705
706
706
707
707
708
708
708
709
709
709
709
710
710
710
711
712
712

.
725
. C++
727
.
728
.
736

807

ASCII, 62; 732


, 625

, 626
, 631
, 101
, 539
, 626
, 113
, 626
, 266
, 323
, 452
, 429

, 610
, 47
, 732

, 633
, 731
, 466

ANSI, 548

, 307
iostream, 505
, 326
, 505

, 596; 624
, 731
#define, 674
#else, 675
, 699
#endif, 675
, 701
#ifdef, 674
, 506

#ifndef, 674
#include, 673
-
(#), 682
, 531
(##), 682
, 525
, 514
, 700

, 530
, 305
, 638
, 509
, 415
, 458
, 515
, 305
, 522
, 708
, 509
, 538
, 458
-, 483
, 692
, 603
, 517
3
, 511
, 313
, 524; 530


, 333

, 271
, 338
, 351
, 344

- , 505
Java, 409
, 646; 685
, 658
, 647
, 655
, 662
, 645
, 647
, 631

, 634
, 732

Animal, 599; 693


CAT, 273; 292; 342; 413
Counter, 276
deque, 633
Employee, 456
iostream, 510
list, 631
Mammal, 303
map, 634
ofstream, 531
ostream, 522
PartsCatalog, 465
Pegasus, 374
Rectangle, 264
String, 354; 452; 627; 687
Timer, 408
vector, 625
, 638
, 452

, 466

, 483
, 536
, 686
, 655
, 624
, 395
, 371; 597
, 677

, 650
, 677
, 708
-, 509
, 727
catch, 647
class, 303
const, 65; 709
enum, 66
inline, 122; 680
namespace, 548
new, 347
operator, 286
protected, 305
return, 114
static, 415; 548
template, 597
try, 647
typedef, 59; 431
using, 553
virtual, 322
, 57
, 44; 707

, 674
, , 674

, 64
#define,
65; 674
const, 65
, 66

, 64

, 64

, 307
, 327
, 269

, 309
, 272
, 269; 309
, 294
,
384
, 624
, 634
, 625
, 633
, 634
, 625
, 631
, 544
, 351; 512

, 327
, 272
, 272

, 674
DEBUG, 683

, 678
assert(), 683; 709
EVAL, 698
MAX, 678
MIN, 678
PRINT(x), 692
, 683
, 700

argv, 538
,
347
,
348

, 335
, 348
, 333
, 338; 344
, 343
, 333
, 341
, 340
, 351
,
350
, 346
, 436
, 426
, 598

, 377
, 375
, 317; 387

, 404
, 391
, 475
, 305
, 380
, 302
, 387
, 303; 466
, 303

, 110; 546
, 183

cin, 510
cout, 42; 522
ofstream, 531
-, 509
, 546
, 280
, 281
, 324
, 271

, 272
, 277
, 291
,
307
, 287
,
307
, 638

break, 171; 189


catch, 652
continue, 171
delete[], 350
dynamic_cast, 377
endl, 43
for, 177
goto, 167
return, 105; 114
switch, 186; 187; 705
using, 553
watch, 711
while, 169
, 725
(>>), 510
(::), 545
(<<), 497; 522
, 638
([]), 341; 342; 602;
626
(&), 358
, 358
, 286; 289
, 290
, 276; 290
, 699
, 296
, 725
(=), 291; 296; 602
, 289
, 286
(+), 286
, 280

, 290
,
317

,104
, 668

, 686
assert(), 685
, 693
, 634

, 129
, 129
, 52
, 129
, 47; 101
, 102
, 112
, 116

, 269
, 497
, 288; 359
, 284
, 278
, 119; 264

, 51
, 108; 129
, 54
, 51; 55
, 55; 58
, 106
, 51
, 61
, 52
, 413; 620
, 66
, 638
, 686
, 319

, 732
, 284

iostream, 510
ofstream, 531
ostream, 522
-, 509
, 526
, 284
, 673

HELLO.CPP, 40
, 44
, 683
, 704

Window, 548
, 550
, 550
, 557
, 544
, 548
, 557
std, 548; 558; 625
, 102

, 129
, 123

, 360
, 631
,
361
, 362
, 361
, 361

, 323
, 313
, 102

ASCII, 54; 62
, 44

, 669

, 63
, 43; 64
, 62
, 63
, 44; 64
, 530
, 728
, 730
, 729
, 732
, 631

STL, 624
, 129; 633
, 633
, 652
, 704
, 42; 351
, 351
, 358
, 359

, 323
, 47

char, 62 long, 60
short, 60
void, 47
(ADT), 396
(), 54
, 53
, 53
, 360
typedef, 59;
431
, 377
, 597
, 52; 57
, 294
, 669


ptr, 323; 436
rhs, 275
this, 283; 420
vptr, 323
, 130
, 433
, 348
, 420

, 676
, 536
-, 532
, 673
, 536
, 677
algorithm, 638
iomanip.h, 530
iostream.h, 43
list, 631
map, 634
stack, 633
stdio.h, 528
strin.h, 353
String.hpp, 458
vector, 625
, 102
, 102
, , 124; 184

, 699
, 701
, 700
, 700

stmcpy(), 353

bad(), 532
cin,get(), 515
cin.getline(), 518
cin.ignore(), 520
cin.peek(), 521

cin.putback(), 521
close(), 532
cout.fill, 525
cout.put(), 522
cout.setf, 526
cout.width(), 524
cout.write(), 523
eof(), 532
fail(), 532
flush(), 522
Invariants(), 686
main(), 41; 100; 116
printf(), 528
sizeof(), 53
strcpy(), 353
strlen(), 359
, 47; 101
, 550
, 319; 662
, 101
, 100
, 492
, 603
, 313
, 46; 100
, 102
, 104
, 47
, , 101
, 119; 264
, 122; 680
, 119
, 100
, 102
, 102
,
315
, 615
, 418; 620
, 47

, 266
, 399


, 603

, 167
do...while, 175
for, 177
goto, 167
while, 169
, 189
, 182
, 181

, 596
Array, 597
, 599
, 607

, 599
, 597
, 598
, 597
, 602
, 620
, 597; 610

, 598; 610
, 333
, 340

Вам также может понравиться