Programming: principles and practice using C++
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Upper Saddle River, NJ [u.a.]
Addison-Wesley
2009
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | XXVIII, 1236 S. Ill., graph. Darst. |
ISBN: | 9780321543721 0321543726 |
Internformat
MARC
LEADER | 00000nam a2200000zc 4500 | ||
---|---|---|---|
001 | BV035184990 | ||
003 | DE-604 | ||
005 | 20101207 | ||
007 | t | ||
008 | 081127s2009 xxuad|| |||| 00||| eng d | ||
010 | |a 2008032595 | ||
020 | |a 9780321543721 |c pbk. : alk. paper |9 978-0-321-54372-1 | ||
020 | |a 0321543726 |9 0-321-54372-6 | ||
035 | |a (OCoLC)191927017 | ||
035 | |a (DE-599)GBV566748606 | ||
040 | |a DE-604 |b ger |e aacr | ||
041 | 0 | |a eng | |
044 | |a xxu |c US | ||
049 | |a DE-703 |a DE-20 |a DE-824 |a DE-19 |a DE-11 |a DE-83 |a DE-91G |a DE-861 |a DE-898 | ||
050 | 0 | |a QA76.73.C153 | |
082 | 0 | |a 005.13/3 | |
084 | |a ST 230 |0 (DE-625)143617: |2 rvk | ||
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a DAT 358f |2 stub | ||
100 | 1 | |a Stroustrup, Bjarne |d 1950- |e Verfasser |0 (DE-588)118044710 |4 aut | |
245 | 1 | 0 | |a Programming |b principles and practice using C++ |c Bjarne Stroustrup |
264 | 1 | |a Upper Saddle River, NJ [u.a.] |b Addison-Wesley |c 2009 | |
300 | |a XXVIII, 1236 S. |b Ill., graph. Darst. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 4 | |a C++ (Computer program language) | |
650 | 0 | 7 | |a C++ |0 (DE-588)4193909-8 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a C++ |0 (DE-588)4193909-8 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m GBV Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=016991688&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-016991688 |
Datensatz im Suchindex
_version_ | 1804138360066801664 |
---|---|
adam_text | IMAGE 1
PROGRAMMING
PRI NCIPLES AND PRACTICE
USING C++
BJARNE STROUSTRUP
..,A.., ADDISON-WESLEY
UPPER SADDLE RIVER, NJ * BOSTON * INDIANAPOLIS * SAN FRANCISCO
NEW YORK * TORONTO * MONTREAL * LONDON * MUNIEH * PARIS * MADRID
CAPETOWN * SYDNEY * TOKYO * SINGAPORE * MEXIEO CITY
IMAGE 2
CONTENTS
PREFACE XXIII
CHAPTER 0 NOTES TO THE READER
0.1 THE STRUCTURE OF THIS BOOK 2 0.1.1 GENERAL APPROACH 3 0.1.2 DRILLS,
EXERCISES, ETC. 4 0.1.3 WHAT COMES AFTER THIS BOOK? 5 0.2 A PHILOSOPHY
OF TEACHING AND LEARRUNG 6
0.2.1 THE ORDER OF TOPICS 9 0.2.2 PROGRAMMING AND PROGRAMMING LANGUAGE
10 0.2.3 PORTABILITY 11 0.3 PROGRAMRNING AND COMPUTER SCIENCE 12 0.4
CREATIVITY AND PROBLEM SOLVING 12 0.5 REQUEST FOR FEEDBACK 12
0.6 REFERENCES 13 0.7 BIOGRAPHIES 14 BJARNE STROUSTRUP 14 LAWRENCE
PETE PETERSEN 15
V
IMAGE 3
VI CONTENTS
CHAPTER 1 COMPUTERS, PEOPLE, AND PROGRAMMING 17
1.1 INTRODUCTION 18 1.2 SOFTWARE 19 1.3 PEOPLE 21 1.4 COMPUTER SCIENCE
24
1.5 COMPUTERS ARE EVERYWHERE 25 1.5.1 SCREENS AND NO SCREENS 26 1.5.2
SHIPPING 26 1.5.3 TELECOMMUNICATIONS 28 1.5.4 MEDICINE 30 1.5.5
INFORMATION 31 1.5.6 A VERTICAL VIEW 32 1.5.7 SOWHAT? 34 1.6 IDEALS FOR
PROGRAMMERS 34
PART I THE BASICS 41
CHAPTER 2 HELLO, WORLD! 43
2.1 PROGRAMS 44 2.2 THE CLASSIC FIRST PROGRAM 45 2.3 COMPILATION 47 2.4
LINKING 51 2.5 PROGRAMMING ENVIRONMENTS 52
CHAPTER 3 OBJECTS, TYPES, AND VALUES 59
3.1 INPUT 60 3.2 VARIABLES 62 3.3 INPUT AND TYPE 64 3.4 OPERATIONS AND
OPERATORS 66
3.5 ASSIGNMENT AND INITIALIZATION 69 3.5.1 AN EXAMPLE: DELETE REPEATED
WORDS 71 3.6 COMPOSITE ASSIGNMENT OPERATORS 73 3.6.1 AN EXAMPLE: COUNT
REPEATED WORDS 73 3.7 NAMES 74
3.8 TYPES AND OBJECTS 77 3.9 TYPE SAFETY 78 3.9.1 SAFE CONVERSIONS 79
3.9.2 UNSAFE CONVERSIONS 80
CHAPTER 4 COMPUTATION 89
4.1 COMPUTATION 90 4.2 OBJECTIVES AND TOOLS 92
IMAGE 4
VII CONTENTS
4.3 EXPRESSIONS 94 4.3.1 CONSTANT EXPRESSIONS 95 4.3.2 OPERATORS 96
4.3.3 CONVERSIONS 98
4.4 STATEMENTS 99 4.4.1 SELECTION 101 4.4.2 ITERATION 108
4.5 FUNCTIONS 112 4.5.1 WHY BOTHER WITH FUNCTIONS? 114 4.5.2 FUNCTION
DECLARATIONS 115 4.6 VECTOR 116
4.6.1 GRAWING A VECTOR 118 4.6.2 A NUMERIC EXAMPLE 119 4.6.3 A TEXT
EXAMPLE 121 4.7 LANGUAGE FEATURES 123
CHAPTER 5 ERRORS 131
5.1 INTRODUCTION 132 5.2 SOURCES OF ERRORS 134 5.3 COMPILE-TIME ERRORS
134 5.3.1 SYNTAX ERRORS 135
5.3.2 TYPE ERRORS 136 5.3.3 NON-ERRORS 137 5.4 LINK-TIME ERRORS 137 5.5
RUN-TIME ERRORS 138
5.5.1 THE CALLER DEALS WITH ERRORS 140 5.5.2 THE CALLEE DEALS WITH
ERRORS 141 5.5.3 ERRAR REPORTING 143 5.6 EXCEPTIONS 144
5.6.1 BAD ARGUMENTS 145 5.6.2 RANGE ERRORS 146 5.6.3 BAD INPUT 148 5.6.4
NARROWING ERRORS 151 5.7 LOGIC ERRORS 152 5.8 ESTIMATION 155
5.9 DEBUGGING 156 5.9.1 PRACTICAL DEBUG ADVICE 157 5.10 PRE- AND
POST-CONDITIONS 161 5.10.1 POST-CONDITIONS 163 5.11 TESTING 164
IMAGE 5
VIII CONTENTS
CHAPTER 6 WRITING A PROGRAM 171
6.1 A PROBLEM 172 6.2 THINKING ABOUT THE PROBLEM 173 6.2.1 STAGES OF
DEVELOPMENT 174 6.2.2 STRATEGY 174 6.3 BACK TO THE CALCULATOR! 176
6.3.1 FIRST ATTEMPT 177 6.3.2 TOKENS 179 6.3.3 IMPLEMENTING TOKENS 181
6.3.4 USING TOKENS 183 6.3.5 BACK TO THE DRAWING BOARD 185 6.4 GRAMMARS
186
6.4.1 ADETOUR: ENGLISH GRAMMAR 191 6.4.2 WRITING A GRAMMAR 192 6.5
TUMING A GRARNMAR INTO CODE 193 6.5.1 IMPLEMENTING GRAMMAR MIES 194
6.5.2 EXPRESSIONS 195 6.5.3 TERMS 198 6.5.4 PRIMARY EXPRESSIONS 200 6.6
TRYING THE FIRST VERSION 201 6.7 TRYING THE SECOND VERSION 206 6.8 TOKEN
STREAMS 207 6.8.1 IMPLEMENTING TOKEN_STREAM 209 6.8.2 READING TOKENS 211
6.8.3 READING NUMBERS 212 6.9 PROGRAM STRUCTURE 213
CHAPTER 7 COMPLETING A PROGRAM 219
7.1 INTRODUCTION 220 7.2 INPUT AND OUTPUT 220 7.3 ERROR HANDLING 222 7.4
NEGATIVE NUMBERS 227 7.5 REMAINDER: % 228 7.6 CLEANING UP THE CODE 231
7.6.1 SYMBOLIC CONSTANTS 231 7.6.2 USE OF FUNCTIONS 233 7.6.3 CODE
LAYOUT 234 7.6.4 COMMENTING 236 7.7 RECOVERING FROM ERRORS 238 7.8
VARIABLES 241
7.8.1 VARIABLES AND DEFINITIONS 241 7.8.2 INTRODUCING NARNES 246 7.8.3
PREDEFMED NARNES 249 7.8.4 ARE WE THERE YET? 249
IMAGE 6
IX CONTENTS
CHAPTER 8 TECHNICALITIES: FUNCTIONS, ETC. 253
8.1 TECHNICALITIES 254 8.2 DEDARATIONS AND DEFINITIONS 255 8.2.1 KINDS
OF DECLARATIONS 259 8.2.2 VARIABLE AND CONSTANT DECLARATIONS 260
8.2.3 DEFAULT INITIALIZATION 261 8.3 HEADER FILES 261 8.4 SCOPE 264 8.5
FUNCTION CALL AND RETURN 269
8.5.1 DECLARING ARGUMENTS AND RETURN TYPE 270 8.5.2 RETUMING A VALUE 271
8.5.3 PASS-BY-VALUE 273
8.5.4 PASS-BY-CONST-REFERENCE 273 8.5.5 PASS-BY-REFERENCE 276 8.5.6
PASS-BY-VALUE VS. PASS-BY-REFERENCE 279 8.5.7 ARGUMENT CHECKING AND
CONVERSION 281
8.5.8 FUNCTION CALL IMPLEMENTATION 282 8.6 ORDER OF EVALUATION 287 8.6.1
EXPRESSION EVALUATION 288 8.6.2 GLOBAL INITIALIZATION 288 8.7 NAMESPACES
290
8.7.1 USING DECLARATIONS AND USING DIRECTIVES 291
CHAPTER 9 TECHNICALITIES: CLASSES, ETC. 299
9.1 USER-DEFINED TYPES 300 9.2 CLASSES AND MEMBERS 301 9.3 INTERFACE AND
IMPLEMENTATION 302 9.4 EVOLVING A DASS 304
9.4.1 STRUCT AND FUNCTIONS 304 9.4.2 MEMBER FUNCTIONS AND CONSTRUCTORS
306 9.4.3 KEEP DETAILS PRIVATE 308 9.4.4 DEFMING MEMBER FUNCTIONS 309
9.4.5 REFERRING TO THE CURRENT OBJECT 312 9.4.6 REPORTING ERRORS 313 9.5
ENUMERATIONS 314 9.6 OPERATOR OVERLOADING 316 9.7 CLASS INTERFACES 318
9.7.1 ARGUMENT TYPES 319 9.7.2 COPYING 321 9.7.3 DEFAULT CONSTRUCTORS
322 9.7.4 CONST MEMBER FUNCTIONS 325
9.7.5 MEMBERS AND HELPER FUNCTIONS 326 9.8 THE DATE DASS 328
IMAGE 7
X CONTENTS
PART 11 INPUT AND OUTPUT 337
CHAPTER 10 INPUT AND OUTPUT STREAMS 339
10.1 INPUT AND OUTPUT 340 10.2 THE VO STREAM MODEL 341 10.3 FILES 343
10.4 OPENING A FLLE 344 10.5 READING AND WRITING A FILE 346
10.6 VO ERROR HANDLING 348 10.7 READING A SINGLE VALUE 352 10.7.1
BREAKING THE PROBLEM INTO MANAGEABLE PARTS 353 10.7.2 SEPARATING DIALOG
FROM FUNCTION 356
10.8 USER-DEFINED OUTPUT OPERATORS 357 10.9 USER-DEFINED INPUT OPERATORS
359 10.10 A STANDARD INPUT LOOP 359 10.11 READING A STRUCTURED FILE 361
10.11.1 IN-MEMORY REPRESENTATION 362 10.11.2 READING STRUCTURED VALUES
364 10.11.3 CHANGING REPRESENTATIONS 368
CHAPTER 11 CUSTOMIZING INPUT AND OUTPUT 375
11.1 REGULARITY AND IRREGULARITY 376 11.2 OUTPUT FORMATTING 376 11.2.1
INTEGER OUTPUT 377 11.2.2 INTEGER INPUT 379
11.2.3 FLOATING-POINT OUTPUT 380 11.2.4 PRECISION 382 11.2.5 FIELDS 383
11.3 FILE OPENING AND POSITIONING 384
11.3.1 FILE OPEN MODES 385 11.3.2 BINARY FLIES 386 11.3.3 POSITIONINGIN
FLIES 389 11.4 STRING STREAMS 390 11.5 LINE-ORIENTED INPUT 391 11.6
CHARACTER CLASSIFICATION 392
11.7 USING NONSTANDARD SEPARATORS 394 11.8 AND THERE IS SO MUCH MORE 401
CHAPTER 12 A DISPLAY MODEL 407
12.1 WHY GRAPHICS? 408 12.2 A DISPLAY MODEL 409 12.3 A FIRST EXAMPLE 410
IMAGE 8
XI CONTENTS
12.4 USING A GUI LIBRARY 414 12.5 COORDINATES 415 12.6 SHAPES 416 12.7
USING SHAPE PRIMITIVES 417
12.7.1 GRAPHICS HEADERS AND MAIN 417 12.7.2 AN ALMOST BLANK WINDOW 418
12.7.3 AXIS 420 12.7.4 GRAPHING A FUNCTION 422
12.7.5 POLYGONS 423 12.7.6 RECTANGLES 42JL 12.7.7 FILL 427 12.7.8 TEXT
427 12.7.9 IMAGES 429
]2.7.10 AND MUCH MORE 430 12.8 GETTING THIS TO RUN 431 12.8.1 SOURCE
FILES 432
CHAPTER 13 GRAPHICS CLASSES 437
13.1 OVERVIEW OF GRAPHICS CLASSES 438 13.2 POINT AND UNE 440 13.3 UNES
443
13.4 COLOR 445
13.5 UNE_STYLE 448 13.6 OPEN_POLYLINE 450 13.7 CLOSED_POLYLINE 451 13.8
POLYGON 453
13.9 RECTANGLE 455 13.10 MANAGING UNNAMED OBJECTS 459 13.11 TEXT 462
13.12 CIRDE 464
13.13 ELLIPSE 466 13.14 MARKED_POLYLINE 468 13.15 MARKS 469 13.16 MARK
470 13.17 IMAGES 472
CHAPTER 14 GRAPHICS C1ASS DESIGN 479
14.1 DESIGN PRINCIPLES 480 14.1.1 TYPES 480 14.1.2 OPERATIONS 482 14.1.3
NAMING 483
14.1.4 MUTABILITY 484
IMAGE 9
XII CONTENTS
14.2 SHAPE 485 14.2.1 AN ABSTRACT DASS 487 14.2.2 ACCESS CONTRAL 488
14.2.3 DRAWING SHAPES 491 14.2.4 COPYING AND MUTABILITY 494 14.3 BASE
AND DERIVED CLASSES 496
14.3.1 OBJECT LAYOUT 497 14.3.2 DERIVING DASSES AND DEFMING VIRTUAL
FUNCTIONS 499 14.3.3 OVERRIDING 500 14.3.4 ACCESS 501
14.3.5 PURE VIRTUAL FUNCTIONS 502 14.4 BENEFITS OF OBJECT-ORIENTED
PROGRAMMING 504
CHAPTER 15 GRAPHING FUNCTIONS AND DATA 509
15.1 INTRODUCTION 510 15.2 GRAPHING SIMPLE FUNCTIONS 510 15.3 FUNCTION
514 15.3.1 DEFAULT ARGUMENTS 515
15.3.2 MORE EXAMPLES 517 15.4 AXIS 518 15.5 APPROXIMATION 521 15.6
GRAPHING DATA 526
15.6.1 READING A FILE 528 15.6.2 GENERAL LAYOUT 530 15.6.3 SCALING DATA
531 15.6.4 BUILDING THE GRAPH 532
CHAPTER 16 GRAPHICAL USER INTERFACES 539
16.1 USER INTERFACE ALTERNATIVES 540 16.2 THE NEXT BUTTON 541 16.3 A
SIMPLE WINDOW 542 16.3.1 A CALLBACK FUNCTION 544
16.3.2 A WAIT LOOP 547 16.4 BUTTON AND OTHER WIDGETS 548 16.4.1 WIDGETS
548 16.4.2 BUTTONS 549
16.4.3 LN_BOX AND OUCBOX 550 16.4.4 MENUS 551 16.5 AN EXAMPLE 552 16.6
CONTROL INVERSION 556 16.7 ADDING A MENU 557
16.8 DEBUGGING GUI CODE 562
IMAGE 10
XIII CO NTE NTS
PART 11I DATA AND AIGORITHMS 567
CHAPTER 17 VECTOR AND FREE STORE 569
17.1 INTRODUCTION 570 17.2 VECTOR BASICS 572 17.3 MEMORY, ADDRESSES, AND
POINTERS 574 17.3.1 THE SIZEOF OPERATOR 576
17.4 FREE STORE AND POINTERS 577 17.4.1 FREE-STORE ALLOCATION 578 17.4.2
ACCESS THROUGH POINTERS 579 17.4.3 RANGES 580 17.4.4 INITIALIZATION 582
17.4.5 THE NULL POINTER 583
17.4.6 FREE-STORE DEALLOCATION 584 17.5 DESTRUCTORS 586 17.5.1 GENERATED
DESTRUCTORS 588
17.5.2 DESTRUCTORS AND FREE STORE 589 17.6 ACCESS TO ELEMENTS 590 17.7
POINTERS TO DASS OBJECTS 591 17.8 MESSING WITH TYPES: VOID* AND CASTS
593
17.9 POINTERS AND REFERENCES 595 17.9.1 POINTER AND REFERENCE PARAMETERS
596 17.9.2 POINTERS, REFERENCES, AND INHERITANCE 598 17.9.3 AN EXAMPLE:
LISTS 598 17.9.4 LIST OPERATIONS 600
17.9.5 LIST USE 602 17.10 THE THIS POINTER 603 17.10.1 MORE LINK USE 606
CHAPTER 18 VECTORS AND ARRAYS 611
18.1 INTRODUCTION 612 18.2 COPYING 613 18.2.1 COPY CONSTRUCTORS 614
18.2.2 COPYASSIGNMENTS 616
18.2.3 COPY TERMINOLOGY 618 18.3 ESSENTIAL OPERATIONS 620 18.3.1
EXPLICIT CONSTRUCTORS 621 18.3.2 DEBUGGING CONSTRUCTORS AND DESTRUCTORS
622
18.4 ACCESS TO VECTOR ELEMENTS 625 18.4.1 OVERLOADING ON CONST 626
IMAGE 11
XIV CONTENTS
18.5 ARRAYS 627 18.5.1 POINTERS TO ARRAYELEMENTS 628 18.5.2 POINTERS AND
ARRAYS 631 18.5.3 ARRAY INITIALIZATION 633 18.5.4 POINTER PROBLEMS 634
18.6 EXAMPLES: PALINDROME 637
18.6.1 PALINDROMES USING STRING 637 18.6.2 PALINDROMES USING ARRAYS 638
18.6.3 PALINDROMES USING POINTERS 640
CHAPTER 19 VECTOR, TEMPLATES, AND EXCEPTIONS 645
19.1 THE PROBLEMS 646 19.2 CHANGING SIZE 649 19.2.1 REPRESENTATION 649
19.2.2 RESERVE AND CAPACITY 651
19.2.3 RESIZE 652 19.2.4 PUSH_BACK 652 19.2.5 ASSIGNMENT 653 19.2.6 OUR
VECTOR SO FAR 655 19.3 TEMPLATES 656
19.3.1 TYPES AS TEMPLATE PARAMETERS 656 19.3.2 GENERIC PROGRAMMING 659
19.3.3 CONTAINERS AND INHERITANCE 661 19.3.4 INTEGERS AS TEMPLATE
PARAMETERS 662
19.3.5 TEMPLATE ARGUMENT DEDUCTION 664 19.3.6 GENERALIZING VECTOR 665
19.4 RANGE CHEEKING AND EXEEPTIUENS 668 19.4.1 AN ASIDE: DESIGN
CONSIDERATIONS 670
19.4.2 A CONFCSSION: MACROS 671 19.5 RESUEMEES AND EXEEPTIUENS 672 19.5.1
POTENTIAL RESOUREE MANAGEMENT PROBLEMS 673
19.5.2 RESOUREE AEQUISITION IS INITIALIZATION 675 19.5.3 GUARANTEES 676
19.5.4 AUTO_PTR 678 19.5.5 RAH FOR VECTOR 678
CHAPTER 20 CONTAINERS AND ITERATORS 685
20.1 STORING AND PROEESSING DATA 686 20.1.1 V TORKING WITH DATA 687
20.1.2 GENERALIZING CODE 688 20.2 SN IDEALS 690
IMAGE 12
XV CONTENTS
20.3 SEQUENCES AND ITERATORS 694 20.3.1 BACK TO THE EXAMPLE 696 20.4
LINKED LISTS 698 20.4.1 LIST OPERATIONS 699
20.4.2 ITERATION 701 20.5 GENERALIZING VECTOR YET AGAIN 703 20.6 AN
EXARNPLE: A SIMPLE TEXT EDITOR 704 20.6.1 LINES 707
20.6.2 ITERATION 708 20.7 VECTOR, LIST, AND STRING 711 20.7.1 INSERT AND
ERASE 713 20.8 ADAPTING OUR VECTOR TO THE STL 715 20.9 ADAPTING BUILT-IN
ARRAYS TO THE STL 718 20.10 CONTAINER OVERVIEW 719
20.10.1 ITERATOR CATEGORIES 722
CHAPTER 21 AIGORITHMS AND MAPS 72 7 21.1 STANDARD LIBRARY ALGORITHMS 728
21.2 THE SIMPLEST ALGORITHM: FINDO 729 21.2.1 SOME GENERIC USES 731 21.3
THE GENERAL SEARCH: FIND_IF() 732 21.4 FUNCTION OBJECTS 734
21.4.1 AN ABSTRACT VIEW OFFUNCTION OBJECTS 736 21.4.2 PREDICATES ON DASS
MEMBERS 737 21.5 NUMERICAL ALGORITHMS 738 21.5.1 ACCUMULATE 739
21.5.2 GENERALIZING ACCUMULATEO 740 21.5.3 INNER PRODUCT 742 21.5.4
GENERALIZING INNER_PRODUCTO 743 21.6 ASSOCIATIVE CONTAINERS 744
21.6.1 MAPS 745 21.6.2 MAP OVERVIEW 747 21.6.3 ANOTHER MAP EXAMPLE 750
21.6.4 UNORDERED_MAP 753
21.6.5 SETS 755 21.7 COPYING 757 21.7.1 EOPY 757
21.7.2 STREAM ITERATORS 758 21.7.3 USING A SET TO KEEP ORDER 761 21.7.4
COPY_IF 761 21.8 SORTING AND SEARCHING 762
IMAGE 13
XVI CONTENTS
PART IV BROADENING THE VIEW 769
CHAPTER 22 IDEALS AND HISTORY 771
22.1 HISTORY, IDEALS, AND PROFESSIONALISM 772 22.1.1 PROGRAMMING
LANGUAGE AIMS AND PHILOSOPHIES 772 22.1.2 PROGRAMMING IDEALS 774 22.1.3
STYLES/PARADIGMS 781 22.2 PROGRAMMING LANGUAGE HISTORY OVERVIEW 783
22.2.1 TBE EARLIEST LANGUAGES 784 22.2.2 TBE ROOTS OF MODEM LANGUAGES
786 22.2.3 TBE ALGOL FAMILY 791 22.2.4 SIMULA 798 22.2.5 C 800
22.2.6 C++ 804 22.2.7 TODAY 807 22.2.8 INFORMATION SOUICES 808
CHAPTER 23 TEXT MANIPULATION 813
23.1 TEXT 814
23.2 STRINGS 814
23.3 VO STREAMS 819 23.4 MAPS 820
23.4.1 IMPLEMENTATION DETAILS 826 23.5 A PROBLEM 828 23.6 THE IDEA OF
REGULAR EXPRESSIONS 830 23.7 SEARCHING WITH REGULAR EXPRESSIONS 833
23.8 REGULAR EXPRESSION SYNTAX 836 23.8.1 CHARACTERS AND SPECIAL
CHARACTERS 836 23.8.2 CHARACTER CLASSES 837 23.8.3 REPEATS 838 23.8.4
GROUPING 840 23.8.5 ALTERNATION 840 23.8.6 CHARACTER SETS AND RANGES 841
23.8.7 REGULAR EXPRESSION ERRORS 842 23.9 MATCHING WITH REGULAR
EXPRESSIONS 844 23.10 REFERENCES 849
CHAPTER 24 NUMERICS 853
24.1 INTRODUCTION 854 24.2 SIZE, PRECISION, AND OVERFLOW 854 24.2.1
NUMERIC LIMITS 858
24.3 ARRAYS 859
24.4 C-STYLE MULTIDIMENSIONAL ARRAYS 859
IMAGE 14
CONTENTS XVII
24.5 THE MATRIX LIBRARY 861 24.5.1 DIMENSIONS AND ACCESS 862 24.5.2 ID
MATRIX 865 24.5.3 2D MATRIX 868 24.5.4 MATRIX VO 870
24.5.5 3D MATRIX 871 24.6 AN EXAMPLE: SOLVING LINEAR EQUATIONS 872
24.6.1 CLASSICAL GAUSSIAN ELIMINATION 874
24.6.2 PIVOTING 875 24.6.3 TESTING 876 24.7 RANDOM NUMBERS 877 24.8 THE
STANDARD MATHEMATICAL FUNCTIONS 879 24.9 COMPLEX NUMBERS 880 24.10
REFERENCES 882
CHAPTER 25 EMBEDDED SYSTEMS PROGRAMMING 887
25.1 EMBEDDCD SYSTEMS 888 25.2 BASIC CONCEPTS 891 25.2.1 PREDICTABILITY
894 25.2.2 IDEALS 894
25.2.3 LIVING WITH FAILURE 895 25.3 MEMORY MANAGEMENT 897 25.3.1
FREE-STORE PROBLEMS 898 25.3.2 ALTERNATIVES TO GENERAL FREE STORE 901
25.3.3 POOL EXAMPLE 902 25.3.4 STACK EXAMPLE 903 25.4 ADDRESSES,
POINTERS, AND ARRAYS 905 25.4.1 UNCHECKED CONVERSIONS 905
25.4.2 A PROBLEM: DYSFUNCTIONAL INTERFACES 905 25.4.3 A SOLUTION: AN
INTERFACE DASS 909 25.4.4 INHERITANCE AND CONTAINERS 912 25.5 BITS,
BYTES, AND WORDS 916
25.5.1 BITS AND BIT OPERATIONS 916 25.5.2 BITSET 920 25.5.3 SIGNED AND
UNSIGNED 922 25.5.4 BIT MANIPULATION 926
25.5.5 BITFIE1DS 928 25.5.6 AN EXAMPLE: SIMPLE ENCRYPTION 930 25.6
CODING STANDARDS 935 25.6.1 WHAT SHOULD A CODING STANDARD BE? 936
25.6.2 SAMPIE RULES 937 25.6.3 REAL CODING STANDARDS 943
IMAGE 15
XVIII CONTENTS
CHAPTER 26 TESTING 949
26.1 WHAT WE WANT 950 26.1.1 CAVEAT 951 26.2 PROOFS 952 26.3 TESTING 952
26.3.1 REGRESSION TESTS 953 26.3.2 DNIT TESTS 954 26.3.3 ALGORITHRNS AND
NON-ALGORITHMS 961 26.3.4 SYSTEM TESTS 969 26.3.5 TESTING CLASSES 973
26.3.6 FINDING ASSUMPTIONS THAT DO NOT HOLD 976 26.4 DESIGN FOR TESTING
978 26.5 DEBUGGING 979 26.6 PERFORMANCE 979
26.6.1 TIMING 981 26.7 REFERENCES 983
CHAPTER 27 THE C PROGRAMMING LANGUAGE 987
27.1 C AND C++: SIBLINGS 988 27.1.1 C/C++ COMPATIBILITY 990 27.1.2 C++
FEATURES MISSING FROM C 991 27.1.3 THE C STANDARD LIBRARY 993 27.2
FUNCTIONS 994
27.2.1 NO FUNCTION NAME OVERLOADING 994 27.2.2 FUNCTION ARGUMENT TYPE
CHECKING 995 27.2.3 FUNCTION DEFINITIONS 997 27.2.4 CALLING C FROM C++
AND C++ FROM C 998
27.2.5 POINTERS TO FUNCTIONS 1000 27.3 MINOR LANGUAGE DIFFERENCES 1002
27.3.1 STRUCT TAG NAMESPACE 1002 27.3.2 KEYWORDS 1003
27.3.3 DEFMITIONS 1004 27.3.4 C-STYLE CASTS 1006 27.3.5 CONVERSION
OFVOID* 1007
27.3.6 ENUM 1008 27.3.7 NAMESPACES 1008 27.4 FREE STORE 1009 27.5
C-STYLE STRINGS 1011 27.5.1 C-STYLE STRINGS AND CONST 1013 27.5.2 BYTE
OPERATIONS 1014 27.5.3 AN EXAMPLE: STRCPYO 1015 27.5.4 A STYLE ISSUE
1015
IMAGE 16
CONTENTS XIX
27.6 INPUT/OUTPUT: STDIO 1016 27.6.1 OUTPUT 1016 27.6.2 INPUT 1017
27.6.3 FILES 1019 27.7 CONSTANTS AND MACROS 1020
27.8 MACROS 1021 27.8.1 FUNCTION-LIKE MACROS 1022 27.8.2 SYNTAX MACROS
1023 27.8.3 CONDITIONAL COMPILATION 1024 27.9 AN EXAMPLE: INTRUSIVE
CONTAINERS 1025
PART V APPENDICES 1035
APPENDIX A LANGUAGE SUMMARY 1037
A.1 GENERAL 1038 A.L.L TERMINOLOGY 1039 A.1.2 PROGRAM START AND
TERMINATION 1039 A.1.3 COMMENTS 1040 A.2 LITERALS 1041
A.2.1 INTEGER LITERALS 1041 A.2.2 FLOATING-POINT-LITERALS 1042 A.2.3
BOOLEAN LITERALS 1043 A.2.4 CHARACTER LITERALS 1043
A.2.5 STRING LITERALS 1044 A.2.6 THE POINTER LITERAL 1044 A.3
IDENTIFIERS 1045 A.3.1 KEYWORDS 1045 A.4 SCOPE, STORAGE DASS, AND
LIFETIME 1046
A.4.1 SCOPE 1046 A.4.2 STORAGE DASS 1047 A.4.3 LIFETIME 1048 A.5
EXPRESSIONS 1049 A.5.1 USER-DEFMED OPERATORS 1054
A.5.2 IMPLICIT TYPE CONVERSION 1054 A.5.3 CONSTANT EXPRESSIONS 1056
A.5.4 SIZEOF 1057 A.5.5 LOGICAL EXPRESSIONS 1057
A.5.6 NEW AND DELETE 1057 A.5.7 CASTS 1058 A.6 STATEMENTS 1059 A. 7
DECLARATIONS 1061
A.7.1 DEFINITIONS 1061
IMAGE 17
XX CONTENTS
A8 BUILT-IN TYPES 1062 A8.1 POINTERS 1063 A8.2 ARRAYS 1064 A8.3
REFERENCES 1065 A9 FUNCTIONS 1066
A9.1 OVCRLOAD RESOLUTION 1067 A9.2 DEFAULT ARGUMENTS 1068 A9.3
UNSPECIFIED ARGUMENTS 1068 A9.4 LINKAGE SPECIFICATIONS 1069 A10
USER-DEFMED TYPES 1069
A10.1 OPERATOR OVERLOADING 1069 A.LL ENUMERATIONS 1070 A12 CLASSES 1071
A12.1 MEMBER ACCESS 1071 A12.2 CLASS MEMBER DEFINITIONS 1074 A12.3
CONSTRUCTION, DESTRUCTION, AND COPY 1075 A12.4 DERIVED CLASSES 1078
A.12.5 BITFIELDS 1082 A12.6 UNIONS 1082 A13 TEMPLATES 1083
A13.1 TEMPLATE ARGUMENTS 1084 A13.2 TEMPLATE INSTANTIATION 1084 A.13.3
TEMPLATE MEMBER TYPES 1086 A14 EXCEPTIONS 1086 AIS NAMESPACES 1088 A16
ALIASES 1089 A17 PREPROCESSOR DIRECTIVES 1090 AL7.1 #INCLUDE 1090 AL7.2
#DEFINE 1090
APPENDIX B STANDARD LIBRARY SUMMARY 1093
B.1 OVERVIEW 1094 B.1.1 READER FRIES 1095 B.1.2 NAMESPACE STD 1098 B.1.3
DESCRIPTION STYLE 1098 B.2 ERROR HANDLING 1098
B.2.1 EXCEPTIONS 1099 B.3 ITERATORS 1100 B.3.1 ITERATOR MODEL HOL
B.3.2 ITERATOR CATEGORIES 1103
IMAGE 18
XXI CONTENTS
BA
B.5
B.6
B. 7
B.8
B.9
CONTAINERS 1105 B.4.1 OVERVIEW 1107 B.4.2 MEMBER TYPES 1108 B.4.3
CONSTRUETORS, DESTRUETORS, AND ASSIGNMENTS 1108 B.4.4 ITERATORS 1109
B.4.5 ELEMENT ACCESS 1109 B.4.6 STACK AND QUEUE OPERATIONS 1110 B.4.7
LIST OPERATIONS 1110 B.4.8 SIZE AND CAPACITY 1110
B.4.9 OTHER OPERATIONS 1111 B.4.1O ASSOCIATIVE CONTAINER OPERATIONS 1111
ALGORITHRNS 1112 B.5.1 NONMODIFYING SEQUENCE ALGORITHMS 1113
B.5.2 MODIFYING SEQUENCE ALGORITHMS 1114 B.5.3 UTILITY ALGORITHMS 1116
B.5.4 SORTING AND SEARCHING 1117 B.5.5 SET ALGORITHMS 1118
B.5.6 HEAPS 1119 B.5.7 PERMUTATIONS 1120 B.5.8 MIN AND MAX 1120 SN
UTILITICS 1121
B.6.1 INSERTERS 1121 B.6.2 FUNCTION OBJECTS 1122 B.6.3 PAIR 1123 1/0
STRCAMS 1124
B.7.1 1/0 STREAMS HIERARCHY 1126 B.7.2 ERROR HANDLING 1127 B.7.3 INPUT
OPERATIONS 1128 B.7.4 OUTPUT OPERATIONS 1128 B.7.5 FORMATTING 1129
B.7.6 STANDARD MANIPULATORS 1129 STRING MANIPULATION 1131 B.8.1
CHARACTER CLASSIFICATION 1131 B.8.2 STRING 1132
B.8.3 REGULAR EXPRESSION MATCHING 1133 NUMCRICS 1135 B.9.1
NUMERICALLIMITS 1135 B.9.2 STANDARD MATHEMATICAL FUNCTIONS 1137
B.9.3 COMPLEX 1138 B.9.4 VALARRAY 1139 B.9.5 GENERALIZED NUMERICAL
ALGORITHMS 1139
IMAGE 19
XXII CONTENTS
B.I0 C STANDARD LIBRARY FUNCTIONS 1140 B.10.1 FILES 1140 B.10.2 THE
PRINTFO FAMI1Y 1141 B.10.3 C-STYLE STRINGS 1145 B.10.4 MEMORY 1146
B.10.5 DATE AND TIME 1147 B.10.6 ETC. 1149 B.11 OTHER LIBRARIES 1150
APPENDIX C GETTING STARTED WITH VISUAL STUDIO 1151
G.L GETTING A PROGRAM TO RUN 1152 G.2 INSTALLING VISUAL STUDIO 1152 G.3
CREATING AND RUNNING A PROGRAM 1153 C.3.1 CREATE A NEW PROJECT 1153
C.3.2 USE THE STD_LIB_FACILITIES.H HEADER FILE 1153 C.3.3 ADD A C++
SOURCE FILE TO THE PROJECT 1154 C.3.4 ENTER YOUR SOURCE CODE 1154 C.3.5
BUILD AN EXECUTABLE PROGRAM 1154 C.3.6 EXECUTE THE PROGRAM 1155 C.3.7
SAVE THE PROGRAM 1155 G.4 LATER 1155
APPENDIX 0 INSTALLING FLTK 1157
D.1 INTRODUCTION 1158 D.2 DOWNLOADING FLTK 1158 D.3 INSTALLING FLTK 1159
D.4 USING FLTK IN VISUAL STUDIO 1159 D.5 TESTING IF IT ALL WORKED 1160
APPENDIX E GUI IMPLEMENTATION 1161
E.1 CALLBACK IMPLEMENTATION 1162 E.2 WIDGET IMPLEMENTATION 1163 E.3
WINDOW IMPLEMENTATION 1164 E.4 VECTOR_REF 1166 E.5 AN EXAMPLE:
MANIPULATING WIDGETS 1167
G/OSSARY 1171 BIBLIOGRAPHY 1177 INDEX 1181
|
adam_txt |
IMAGE 1
PROGRAMMING
PRI NCIPLES AND PRACTICE
USING C++
BJARNE STROUSTRUP
.,A., ADDISON-WESLEY
UPPER SADDLE RIVER, NJ * BOSTON * INDIANAPOLIS * SAN FRANCISCO
NEW YORK * TORONTO * MONTREAL * LONDON * MUNIEH * PARIS * MADRID
CAPETOWN * SYDNEY * TOKYO * SINGAPORE * MEXIEO CITY
IMAGE 2
CONTENTS
PREFACE XXIII
CHAPTER 0 NOTES TO THE READER
0.1 THE STRUCTURE OF THIS BOOK 2 0.1.1 GENERAL APPROACH 3 0.1.2 DRILLS,
EXERCISES, ETC. 4 0.1.3 WHAT COMES AFTER THIS BOOK? 5 0.2 A PHILOSOPHY
OF TEACHING AND LEARRUNG 6
0.2.1 THE ORDER OF TOPICS 9 0.2.2 PROGRAMMING AND PROGRAMMING LANGUAGE
10 0.2.3 PORTABILITY 11 0.3 PROGRAMRNING AND COMPUTER SCIENCE 12 0.4
CREATIVITY AND PROBLEM SOLVING 12 0.5 REQUEST FOR FEEDBACK 12
0.6 REFERENCES 13 0.7 BIOGRAPHIES 14 BJARNE STROUSTRUP 14 LAWRENCE
"PETE" PETERSEN 15
V
IMAGE 3
VI CONTENTS
CHAPTER 1 COMPUTERS, PEOPLE, AND PROGRAMMING 17
1.1 INTRODUCTION 18 1.2 SOFTWARE 19 1.3 PEOPLE 21 1.4 COMPUTER SCIENCE
24
1.5 COMPUTERS ARE EVERYWHERE 25 1.5.1 SCREENS AND NO SCREENS 26 1.5.2
SHIPPING 26 1.5.3 TELECOMMUNICATIONS 28 1.5.4 MEDICINE 30 1.5.5
INFORMATION 31 1.5.6 A VERTICAL VIEW 32 1.5.7 SOWHAT? 34 1.6 IDEALS FOR
PROGRAMMERS 34
PART I THE BASICS 41
CHAPTER 2 HELLO, WORLD! 43
2.1 PROGRAMS 44 2.2 THE CLASSIC FIRST PROGRAM 45 2.3 COMPILATION 47 2.4
LINKING 51 2.5 PROGRAMMING ENVIRONMENTS 52
CHAPTER 3 OBJECTS, TYPES, AND VALUES 59
3.1 INPUT 60 3.2 VARIABLES 62 3.3 INPUT AND TYPE 64 3.4 OPERATIONS AND
OPERATORS 66
3.5 ASSIGNMENT AND INITIALIZATION 69 3.5.1 AN EXAMPLE: DELETE REPEATED
WORDS 71 3.6 COMPOSITE ASSIGNMENT OPERATORS 73 3.6.1 AN EXAMPLE: COUNT
REPEATED WORDS 73 3.7 NAMES 74
3.8 TYPES AND OBJECTS 77 3.9 TYPE SAFETY 78 3.9.1 SAFE CONVERSIONS 79
3.9.2 UNSAFE CONVERSIONS 80
CHAPTER 4 COMPUTATION 89
4.1 COMPUTATION 90 4.2 OBJECTIVES AND TOOLS 92
IMAGE 4
VII CONTENTS
4.3 EXPRESSIONS 94 4.3.1 CONSTANT EXPRESSIONS 95 4.3.2 OPERATORS 96
4.3.3 CONVERSIONS 98
4.4 STATEMENTS 99 4.4.1 SELECTION 101 4.4.2 ITERATION 108
4.5 FUNCTIONS 112 4.5.1 WHY BOTHER WITH FUNCTIONS? 114 4.5.2 FUNCTION
DECLARATIONS 115 4.6 VECTOR 116
4.6.1 GRAWING A VECTOR 118 4.6.2 A NUMERIC EXAMPLE 119 4.6.3 A TEXT
EXAMPLE 121 4.7 LANGUAGE FEATURES 123
CHAPTER 5 ERRORS 131
5.1 INTRODUCTION 132 5.2 SOURCES OF ERRORS 134 5.3 COMPILE-TIME ERRORS
134 5.3.1 SYNTAX ERRORS 135
5.3.2 TYPE ERRORS 136 5.3.3 NON-ERRORS 137 5.4 LINK-TIME ERRORS 137 5.5
RUN-TIME ERRORS 138
5.5.1 THE CALLER DEALS WITH ERRORS 140 5.5.2 THE CALLEE DEALS WITH
ERRORS 141 5.5.3 ERRAR REPORTING 143 5.6 EXCEPTIONS 144
5.6.1 BAD ARGUMENTS 145 5.6.2 RANGE ERRORS 146 5.6.3 BAD INPUT 148 5.6.4
NARROWING ERRORS 151 5.7 LOGIC ERRORS 152 5.8 ESTIMATION 155
5.9 DEBUGGING 156 5.9.1 PRACTICAL DEBUG ADVICE 157 5.10 PRE- AND
POST-CONDITIONS 161 5.10.1 POST-CONDITIONS 163 5.11 TESTING 164
IMAGE 5
VIII CONTENTS
CHAPTER 6 WRITING A PROGRAM 171
6.1 A PROBLEM 172 6.2 THINKING ABOUT THE PROBLEM 173 6.2.1 STAGES OF
DEVELOPMENT 174 6.2.2 STRATEGY 174 6.3 BACK TO THE CALCULATOR! 176
6.3.1 FIRST ATTEMPT 177 6.3.2 TOKENS 179 6.3.3 IMPLEMENTING TOKENS 181
6.3.4 USING TOKENS 183 6.3.5 BACK TO THE DRAWING BOARD 185 6.4 GRAMMARS
186
6.4.1 ADETOUR: ENGLISH GRAMMAR 191 6.4.2 WRITING A GRAMMAR 192 6.5
TUMING A GRARNMAR INTO CODE 193 6.5.1 IMPLEMENTING GRAMMAR MIES 194
6.5.2 EXPRESSIONS 195 6.5.3 TERMS 198 6.5.4 PRIMARY EXPRESSIONS 200 6.6
TRYING THE FIRST VERSION 201 6.7 TRYING THE SECOND VERSION 206 6.8 TOKEN
STREAMS 207 6.8.1 IMPLEMENTING TOKEN_STREAM 209 6.8.2 READING TOKENS 211
6.8.3 READING NUMBERS 212 6.9 PROGRAM STRUCTURE 213
CHAPTER 7 COMPLETING A PROGRAM 219
7.1 INTRODUCTION 220 7.2 INPUT AND OUTPUT 220 7.3 ERROR HANDLING 222 7.4
NEGATIVE NUMBERS 227 7.5 REMAINDER: % 228 7.6 CLEANING UP THE CODE 231
7.6.1 SYMBOLIC CONSTANTS 231 7.6.2 USE OF FUNCTIONS 233 7.6.3 CODE
LAYOUT 234 7.6.4 COMMENTING 236 7.7 RECOVERING FROM ERRORS 238 7.8
VARIABLES 241
7.8.1 VARIABLES AND DEFINITIONS 241 7.8.2 INTRODUCING NARNES 246 7.8.3
PREDEFMED NARNES 249 7.8.4 ARE WE THERE YET? 249
IMAGE 6
IX CONTENTS
CHAPTER 8 TECHNICALITIES: FUNCTIONS, ETC. 253
8.1 TECHNICALITIES 254 8.2 DEDARATIONS AND DEFINITIONS 255 8.2.1 KINDS
OF DECLARATIONS 259 8.2.2 VARIABLE AND CONSTANT DECLARATIONS 260
8.2.3 DEFAULT INITIALIZATION 261 8.3 HEADER FILES 261 8.4 SCOPE 264 8.5
FUNCTION CALL AND RETURN 269
8.5.1 DECLARING ARGUMENTS AND RETURN TYPE 270 8.5.2 RETUMING A VALUE 271
8.5.3 PASS-BY-VALUE 273
8.5.4 PASS-BY-CONST-REFERENCE 273 8.5.5 PASS-BY-REFERENCE 276 8.5.6
PASS-BY-VALUE VS. PASS-BY-REFERENCE 279 8.5.7 ARGUMENT CHECKING AND
CONVERSION 281
8.5.8 FUNCTION CALL IMPLEMENTATION 282 8.6 ORDER OF EVALUATION 287 8.6.1
EXPRESSION EVALUATION 288 8.6.2 GLOBAL INITIALIZATION 288 8.7 NAMESPACES
290
8.7.1 USING DECLARATIONS AND USING DIRECTIVES 291
CHAPTER 9 TECHNICALITIES: CLASSES, ETC. 299
9.1 USER-DEFINED TYPES 300 9.2 CLASSES AND MEMBERS 301 9.3 INTERFACE AND
IMPLEMENTATION 302 9.4 EVOLVING A DASS 304
9.4.1 STRUCT AND FUNCTIONS 304 9.4.2 MEMBER FUNCTIONS AND CONSTRUCTORS
306 9.4.3 KEEP DETAILS PRIVATE 308 9.4.4 DEFMING MEMBER FUNCTIONS 309
9.4.5 REFERRING TO THE CURRENT OBJECT 312 9.4.6 REPORTING ERRORS 313 9.5
ENUMERATIONS 314 9.6 OPERATOR OVERLOADING 316 9.7 CLASS INTERFACES 318
9.7.1 ARGUMENT TYPES 319 9.7.2 COPYING 321 9.7.3 DEFAULT CONSTRUCTORS
322 9.7.4 CONST MEMBER FUNCTIONS 325
9.7.5 MEMBERS AND "HELPER FUNCTIONS" 326 9.8 THE DATE DASS 328
IMAGE 7
X CONTENTS
PART 11 INPUT AND OUTPUT 337
CHAPTER 10 INPUT AND OUTPUT STREAMS 339
10.1 INPUT AND OUTPUT 340 10.2 THE VO STREAM MODEL 341 10.3 FILES 343
10.4 OPENING A FLLE 344 10.5 READING AND WRITING A FILE 346
10.6 VO ERROR HANDLING 348 10.7 READING A SINGLE VALUE 352 10.7.1
BREAKING THE PROBLEM INTO MANAGEABLE PARTS 353 10.7.2 SEPARATING DIALOG
FROM FUNCTION 356
10.8 USER-DEFINED OUTPUT OPERATORS 357 10.9 USER-DEFINED INPUT OPERATORS
359 10.10 A STANDARD INPUT LOOP 359 10.11 READING A STRUCTURED FILE 361
10.11.1 IN-MEMORY REPRESENTATION 362 10.11.2 READING STRUCTURED VALUES
364 10.11.3 CHANGING REPRESENTATIONS 368
CHAPTER 11 CUSTOMIZING INPUT AND OUTPUT 375
11.1 REGULARITY AND IRREGULARITY 376 11.2 OUTPUT FORMATTING 376 11.2.1
INTEGER OUTPUT 377 11.2.2 INTEGER INPUT 379
11.2.3 FLOATING-POINT OUTPUT 380 11.2.4 PRECISION 382 11.2.5 FIELDS 383
11.3 FILE OPENING AND POSITIONING 384
11.3.1 FILE OPEN MODES 385 11.3.2 BINARY FLIES 386 11.3.3 POSITIONINGIN
FLIES 389 11.4 STRING STREAMS 390 11.5 LINE-ORIENTED INPUT 391 11.6
CHARACTER CLASSIFICATION 392
11.7 USING NONSTANDARD SEPARATORS 394 11.8 AND THERE IS SO MUCH MORE 401
CHAPTER 12 A DISPLAY MODEL 407
12.1 WHY GRAPHICS? 408 12.2 A DISPLAY MODEL 409 12.3 A FIRST EXAMPLE 410
IMAGE 8
XI CONTENTS
12.4 USING A GUI LIBRARY 414 12.5 COORDINATES 415 12.6 SHAPES 416 12.7
USING SHAPE PRIMITIVES 417
12.7.1 GRAPHICS HEADERS AND MAIN 417 12.7.2 AN ALMOST BLANK WINDOW 418
12.7.3 AXIS 420 12.7.4 GRAPHING A FUNCTION 422
12.7.5 POLYGONS 423 12.7.6 RECTANGLES 42JL 12.7.7 FILL 427 12.7.8 TEXT
427 12.7.9 IMAGES 429
]2.7.10 AND MUCH MORE 430 12.8 GETTING THIS TO RUN 431 12.8.1 SOURCE
FILES 432
CHAPTER 13 GRAPHICS CLASSES 437
13.1 OVERVIEW OF GRAPHICS CLASSES 438 13.2 POINT AND UNE 440 13.3 UNES
443
13.4 COLOR 445
13.5 UNE_STYLE 448 13.6 OPEN_POLYLINE 450 13.7 CLOSED_POLYLINE 451 13.8
POLYGON 453
13.9 RECTANGLE 455 13.10 MANAGING UNNAMED OBJECTS 459 13.11 TEXT 462
13.12 CIRDE 464
13.13 ELLIPSE 466 13.14 MARKED_POLYLINE 468 13.15 MARKS 469 13.16 MARK
470 13.17 IMAGES 472
CHAPTER 14 GRAPHICS C1ASS DESIGN 479
14.1 DESIGN PRINCIPLES 480 14.1.1 TYPES 480 14.1.2 OPERATIONS 482 14.1.3
NAMING 483
14.1.4 MUTABILITY 484
IMAGE 9
XII CONTENTS
14.2 SHAPE 485 14.2.1 AN ABSTRACT DASS 487 14.2.2 ACCESS CONTRAL 488
14.2.3 DRAWING SHAPES 491 14.2.4 COPYING AND MUTABILITY 494 14.3 BASE
AND DERIVED CLASSES 496
14.3.1 OBJECT LAYOUT 497 14.3.2 DERIVING DASSES AND DEFMING VIRTUAL
FUNCTIONS 499 14.3.3 OVERRIDING 500 14.3.4 ACCESS 501
14.3.5 PURE VIRTUAL FUNCTIONS 502 14.4 BENEFITS OF OBJECT-ORIENTED
PROGRAMMING 504
CHAPTER 15 GRAPHING FUNCTIONS AND DATA 509
15.1 INTRODUCTION 510 15.2 GRAPHING SIMPLE FUNCTIONS 510 15.3 FUNCTION
514 15.3.1 DEFAULT ARGUMENTS 515
15.3.2 MORE EXAMPLES 517 15.4 AXIS 518 15.5 APPROXIMATION 521 15.6
GRAPHING DATA 526
15.6.1 READING A FILE 528 15.6.2 GENERAL LAYOUT 530 15.6.3 SCALING DATA
531 15.6.4 BUILDING THE GRAPH 532
CHAPTER 16 GRAPHICAL USER INTERFACES 539
16.1 USER INTERFACE ALTERNATIVES 540 16.2 THE "NEXT" BUTTON 541 16.3 A
SIMPLE WINDOW 542 16.3.1 A CALLBACK FUNCTION 544
16.3.2 A WAIT LOOP 547 16.4 BUTTON AND OTHER WIDGETS 548 16.4.1 WIDGETS
548 16.4.2 BUTTONS 549
16.4.3 LN_BOX AND OUCBOX 550 16.4.4 MENUS 551 16.5 AN EXAMPLE 552 16.6
CONTROL INVERSION 556 16.7 ADDING A MENU 557
16.8 DEBUGGING GUI CODE 562
IMAGE 10
XIII CO NTE NTS
PART 11I DATA AND AIGORITHMS 567
CHAPTER 17 VECTOR AND FREE STORE 569
17.1 INTRODUCTION 570 17.2 VECTOR BASICS 572 17.3 MEMORY, ADDRESSES, AND
POINTERS 574 17.3.1 THE SIZEOF OPERATOR 576
17.4 FREE STORE AND POINTERS 577 17.4.1 FREE-STORE ALLOCATION 578 17.4.2
ACCESS THROUGH POINTERS 579 17.4.3 RANGES 580 17.4.4 INITIALIZATION 582
17.4.5 THE NULL POINTER 583
17.4.6 FREE-STORE DEALLOCATION 584 17.5 DESTRUCTORS 586 17.5.1 GENERATED
DESTRUCTORS 588
17.5.2 DESTRUCTORS AND FREE STORE 589 17.6 ACCESS TO ELEMENTS 590 17.7
POINTERS TO DASS OBJECTS 591 17.8 MESSING WITH TYPES: VOID* AND CASTS
593
17.9 POINTERS AND REFERENCES 595 17.9.1 POINTER AND REFERENCE PARAMETERS
596 17.9.2 POINTERS, REFERENCES, AND INHERITANCE 598 17.9.3 AN EXAMPLE:
LISTS 598 17.9.4 LIST OPERATIONS 600
17.9.5 LIST USE 602 17.10 THE THIS POINTER 603 17.10.1 MORE LINK USE 606
CHAPTER 18 VECTORS AND ARRAYS 611
18.1 INTRODUCTION 612 18.2 COPYING 613 18.2.1 COPY CONSTRUCTORS 614
18.2.2 COPYASSIGNMENTS 616
18.2.3 COPY TERMINOLOGY 618 18.3 ESSENTIAL OPERATIONS 620 18.3.1
EXPLICIT CONSTRUCTORS 621 18.3.2 DEBUGGING CONSTRUCTORS AND DESTRUCTORS
622
18.4 ACCESS TO VECTOR ELEMENTS 625 18.4.1 OVERLOADING ON CONST 626
IMAGE 11
XIV CONTENTS
18.5 ARRAYS 627 18.5.1 POINTERS TO ARRAYELEMENTS 628 18.5.2 POINTERS AND
ARRAYS 631 18.5.3 ARRAY INITIALIZATION 633 18.5.4 POINTER PROBLEMS 634
18.6 EXAMPLES: PALINDROME 637
18.6.1 PALINDROMES USING STRING 637 18.6.2 PALINDROMES USING ARRAYS 638
18.6.3 PALINDROMES USING POINTERS 640
CHAPTER 19 VECTOR, TEMPLATES, AND EXCEPTIONS 645
19.1 THE PROBLEMS 646 19.2 CHANGING SIZE 649 19.2.1 REPRESENTATION 649
19.2.2 RESERVE AND CAPACITY 651
19.2.3 RESIZE 652 19.2.4 PUSH_BACK 652 19.2.5 ASSIGNMENT 653 19.2.6 OUR
VECTOR SO FAR 655 19.3 TEMPLATES 656
19.3.1 TYPES AS TEMPLATE PARAMETERS 656 19.3.2 GENERIC PROGRAMMING 659
19.3.3 CONTAINERS AND INHERITANCE 661 19.3.4 INTEGERS AS TEMPLATE
PARAMETERS 662
19.3.5 TEMPLATE ARGUMENT DEDUCTION 664 19.3.6 GENERALIZING VECTOR 665
19.4 RANGE CHEEKING AND EXEEPTIUENS 668 19.4.1 AN ASIDE: DESIGN
CONSIDERATIONS 670
19.4.2 A CONFCSSION: MACROS 671 19.5 RESUEMEES AND EXEEPTIUENS 672 19.5.1
POTENTIAL RESOUREE MANAGEMENT PROBLEMS 673
19.5.2 RESOUREE AEQUISITION IS INITIALIZATION 675 19.5.3 GUARANTEES 676
19.5.4 AUTO_PTR 678 19.5.5 RAH FOR VECTOR 678
CHAPTER 20 CONTAINERS AND ITERATORS 685
20.1 STORING AND PROEESSING DATA 686 20.1.1 V\TORKING WITH DATA 687
20.1.2 GENERALIZING CODE 688 20.2 SN IDEALS 690
IMAGE 12
XV CONTENTS
20.3 SEQUENCES AND ITERATORS 694 20.3.1 BACK TO THE EXAMPLE 696 20.4
LINKED LISTS 698 20.4.1 LIST OPERATIONS 699
20.4.2 ITERATION 701 20.5 GENERALIZING VECTOR YET AGAIN 703 20.6 AN
EXARNPLE: A SIMPLE TEXT EDITOR 704 20.6.1 LINES 707
20.6.2 ITERATION 708 20.7 VECTOR, LIST, AND STRING 711 20.7.1 INSERT AND
ERASE 713 20.8 ADAPTING OUR VECTOR TO THE STL 715 20.9 ADAPTING BUILT-IN
ARRAYS TO THE STL 718 20.10 CONTAINER OVERVIEW 719
20.10.1 ITERATOR CATEGORIES 722
CHAPTER 21 AIGORITHMS AND MAPS 72 7 21.1 STANDARD LIBRARY ALGORITHMS 728
21.2 THE SIMPLEST ALGORITHM: FINDO 729 21.2.1 SOME GENERIC USES 731 21.3
THE GENERAL SEARCH: FIND_IF() 732 21.4 FUNCTION OBJECTS 734
21.4.1 AN ABSTRACT VIEW OFFUNCTION OBJECTS 736 21.4.2 PREDICATES ON DASS
MEMBERS 737 21.5 NUMERICAL ALGORITHMS 738 21.5.1 ACCUMULATE 739
21.5.2 GENERALIZING ACCUMULATEO 740 21.5.3 INNER PRODUCT 742 21.5.4
GENERALIZING INNER_PRODUCTO 743 21.6 ASSOCIATIVE CONTAINERS 744
21.6.1 MAPS 745 21.6.2 MAP OVERVIEW 747 21.6.3 ANOTHER MAP EXAMPLE 750
21.6.4 UNORDERED_MAP 753
21.6.5 SETS 755 21.7 COPYING 757 21.7.1 EOPY 757
21.7.2 STREAM ITERATORS 758 21.7.3 USING A SET TO KEEP ORDER 761 21.7.4
COPY_IF 761 21.8 SORTING AND SEARCHING 762
IMAGE 13
XVI CONTENTS
PART IV BROADENING THE VIEW 769
CHAPTER 22 IDEALS AND HISTORY 771
22.1 HISTORY, IDEALS, AND PROFESSIONALISM 772 22.1.1 PROGRAMMING
LANGUAGE AIMS AND PHILOSOPHIES 772 22.1.2 PROGRAMMING IDEALS 774 22.1.3
STYLES/PARADIGMS 781 22.2 PROGRAMMING LANGUAGE HISTORY OVERVIEW 783
22.2.1 'TBE EARLIEST LANGUAGES 784 22.2.2 'TBE ROOTS OF MODEM LANGUAGES
786 22.2.3 'TBE ALGOL FAMILY 791 22.2.4 SIMULA 798 22.2.5 C 800
22.2.6 C++ 804 22.2.7 TODAY 807 22.2.8 INFORMATION SOUICES 808
CHAPTER 23 TEXT MANIPULATION 813
23.1 TEXT 814
23.2 STRINGS 814
23.3 VO STREAMS 819 23.4 MAPS 820
23.4.1 IMPLEMENTATION DETAILS 826 23.5 A PROBLEM 828 23.6 THE IDEA OF
REGULAR EXPRESSIONS 830 23.7 SEARCHING WITH REGULAR EXPRESSIONS 833
23.8 REGULAR EXPRESSION SYNTAX 836 23.8.1 CHARACTERS AND SPECIAL
CHARACTERS 836 23.8.2 CHARACTER CLASSES 837 23.8.3 REPEATS 838 23.8.4
GROUPING 840 23.8.5 ALTERNATION 840 23.8.6 CHARACTER SETS AND RANGES 841
23.8.7 REGULAR EXPRESSION ERRORS 842 23.9 MATCHING WITH REGULAR
EXPRESSIONS 844 23.10 REFERENCES 849
CHAPTER 24 NUMERICS 853
24.1 INTRODUCTION 854 24.2 SIZE, PRECISION, AND OVERFLOW 854 24.2.1
NUMERIC LIMITS 858
24.3 ARRAYS 859
24.4 C-STYLE MULTIDIMENSIONAL ARRAYS 859
IMAGE 14
CONTENTS XVII
24.5 THE MATRIX LIBRARY 861 24.5.1 DIMENSIONS AND ACCESS 862 24.5.2 ID
MATRIX 865 24.5.3 2D MATRIX 868 24.5.4 MATRIX VO 870
24.5.5 3D MATRIX 871 24.6 AN EXAMPLE: SOLVING LINEAR EQUATIONS 872
24.6.1 CLASSICAL GAUSSIAN ELIMINATION 874
24.6.2 PIVOTING 875 24.6.3 TESTING 876 24.7 RANDOM NUMBERS 877 24.8 THE
STANDARD MATHEMATICAL FUNCTIONS 879 24.9 COMPLEX NUMBERS 880 24.10
REFERENCES 882
CHAPTER 25 EMBEDDED SYSTEMS PROGRAMMING 887
25.1 EMBEDDCD SYSTEMS 888 25.2 BASIC CONCEPTS 891 25.2.1 PREDICTABILITY
894 25.2.2 IDEALS 894
25.2.3 LIVING WITH FAILURE 895 25.3 MEMORY MANAGEMENT 897 25.3.1
FREE-STORE PROBLEMS 898 25.3.2 ALTERNATIVES TO GENERAL FREE STORE 901
25.3.3 POOL EXAMPLE 902 25.3.4 STACK EXAMPLE 903 25.4 ADDRESSES,
POINTERS, AND ARRAYS 905 25.4.1 UNCHECKED CONVERSIONS 905
25.4.2 A PROBLEM: DYSFUNCTIONAL INTERFACES 905 25.4.3 A SOLUTION: AN
INTERFACE DASS 909 25.4.4 INHERITANCE AND CONTAINERS 912 25.5 BITS,
BYTES, AND WORDS 916
25.5.1 BITS AND BIT OPERATIONS 916 25.5.2 BITSET 920 25.5.3 SIGNED AND
UNSIGNED 922 25.5.4 BIT MANIPULATION 926
25.5.5 BITFIE1DS 928 25.5.6 AN EXAMPLE: SIMPLE ENCRYPTION 930 25.6
CODING STANDARDS 935 25.6.1 WHAT SHOULD A CODING STANDARD BE? 936
25.6.2 SAMPIE RULES 937 25.6.3 REAL CODING STANDARDS 943
IMAGE 15
XVIII CONTENTS
CHAPTER 26 TESTING 949
26.1 WHAT WE WANT 950 26.1.1 CAVEAT 951 26.2 PROOFS 952 26.3 TESTING 952
26.3.1 REGRESSION TESTS 953 26.3.2 DNIT TESTS 954 26.3.3 ALGORITHRNS AND
NON-ALGORITHMS 961 26.3.4 SYSTEM TESTS 969 26.3.5 TESTING CLASSES 973
26.3.6 FINDING ASSUMPTIONS THAT DO NOT HOLD 976 26.4 DESIGN FOR TESTING
978 26.5 DEBUGGING 979 26.6 PERFORMANCE 979
26.6.1 TIMING 981 26.7 REFERENCES 983
CHAPTER 27 THE C PROGRAMMING LANGUAGE 987
27.1 C AND C++: SIBLINGS 988 27.1.1 C/C++ COMPATIBILITY 990 27.1.2 C++
FEATURES MISSING FROM C 991 27.1.3 THE C STANDARD LIBRARY 993 27.2
FUNCTIONS 994
27.2.1 NO FUNCTION NAME OVERLOADING 994 27.2.2 FUNCTION ARGUMENT TYPE
CHECKING 995 27.2.3 FUNCTION DEFINITIONS 997 27.2.4 CALLING C FROM C++
AND C++ FROM C 998
27.2.5 POINTERS TO FUNCTIONS 1000 27.3 MINOR LANGUAGE DIFFERENCES 1002
27.3.1 STRUCT TAG NAMESPACE 1002 27.3.2 KEYWORDS 1003
27.3.3 DEFMITIONS 1004 27.3.4 C-STYLE CASTS 1006 27.3.5 CONVERSION
OFVOID* 1007
27.3.6 ENUM 1008 27.3.7 NAMESPACES 1008 27.4 FREE STORE 1009 27.5
C-STYLE STRINGS 1011 27.5.1 C-STYLE STRINGS AND CONST 1013 27.5.2 BYTE
OPERATIONS 1014 27.5.3 AN EXAMPLE: STRCPYO 1015 27.5.4 A STYLE ISSUE
1015
IMAGE 16
CONTENTS XIX
27.6 INPUT/OUTPUT: STDIO 1016 27.6.1 OUTPUT 1016 27.6.2 INPUT 1017
27.6.3 FILES 1019 27.7 CONSTANTS AND MACROS 1020
27.8 MACROS 1021 27.8.1 FUNCTION-LIKE MACROS 1022 27.8.2 SYNTAX MACROS
1023 27.8.3 CONDITIONAL COMPILATION 1024 27.9 AN EXAMPLE: INTRUSIVE
CONTAINERS 1025
PART V APPENDICES 1035
APPENDIX A LANGUAGE SUMMARY 1037
A.1 GENERAL 1038 A.L.L TERMINOLOGY 1039 A.1.2 PROGRAM START AND
TERMINATION 1039 A.1.3 COMMENTS 1040 A.2 LITERALS 1041
A.2.1 INTEGER LITERALS 1041 A.2.2 FLOATING-POINT-LITERALS 1042 A.2.3
BOOLEAN LITERALS 1043 A.2.4 CHARACTER LITERALS 1043
A.2.5 STRING LITERALS 1044 A.2.6 THE POINTER LITERAL 1044 A.3
IDENTIFIERS 1045 A.3.1 KEYWORDS 1045 A.4 SCOPE, STORAGE DASS, AND
LIFETIME 1046
A.4.1 SCOPE 1046 A.4.2 STORAGE DASS 1047 A.4.3 LIFETIME 1048 A.5
EXPRESSIONS 1049 A.5.1 USER-DEFMED OPERATORS 1054
A.5.2 IMPLICIT TYPE CONVERSION 1054 A.5.3 CONSTANT EXPRESSIONS 1056
A.5.4 SIZEOF 1057 A.5.5 LOGICAL EXPRESSIONS 1057
A.5.6 NEW AND DELETE 1057 A.5.7 CASTS 1058 A.6 STATEMENTS 1059 A. 7
DECLARATIONS 1061
A.7.1 DEFINITIONS 1061
IMAGE 17
XX CONTENTS
A8 BUILT-IN TYPES 1062 A8.1 POINTERS 1063 A8.2 ARRAYS 1064 A8.3
REFERENCES 1065 A9 FUNCTIONS 1066
A9.1 OVCRLOAD RESOLUTION 1067 A9.2 DEFAULT ARGUMENTS 1068 A9.3
UNSPECIFIED ARGUMENTS 1068 A9.4 LINKAGE SPECIFICATIONS 1069 A10
USER-DEFMED TYPES 1069
A10.1 OPERATOR OVERLOADING 1069 A.LL ENUMERATIONS 1070 A12 CLASSES 1071
A12.1 MEMBER ACCESS 1071 A12.2 CLASS MEMBER DEFINITIONS 1074 A12.3
CONSTRUCTION, DESTRUCTION, AND COPY 1075 A12.4 DERIVED CLASSES 1078
A.12.5 BITFIELDS 1082 A12.6 UNIONS 1082 A13 TEMPLATES 1083
A13.1 TEMPLATE ARGUMENTS 1084 A13.2 TEMPLATE INSTANTIATION 1084 A.13.3
TEMPLATE MEMBER TYPES 1086 A14 EXCEPTIONS 1086 AIS NAMESPACES 1088 A16
ALIASES 1089 A17 PREPROCESSOR DIRECTIVES 1090 AL7.1 #INCLUDE 1090 AL7.2
#DEFINE 1090
APPENDIX B STANDARD LIBRARY SUMMARY 1093
B.1 OVERVIEW 1094 B.1.1 READER FRIES 1095 B.1.2 NAMESPACE STD 1098 B.1.3
DESCRIPTION STYLE 1098 B.2 ERROR HANDLING 1098
B.2.1 EXCEPTIONS 1099 B.3 ITERATORS 1100 B.3.1 ITERATOR MODEL HOL
B.3.2 ITERATOR CATEGORIES 1103
IMAGE 18
XXI CONTENTS
BA
B.5
B.6
B. 7
B.8
B.9
CONTAINERS 1105 B.4.1 OVERVIEW 1107 B.4.2 MEMBER TYPES 1108 B.4.3
CONSTRUETORS, DESTRUETORS, AND ASSIGNMENTS 1108 B.4.4 ITERATORS 1109
B.4.5 ELEMENT ACCESS 1109 B.4.6 STACK AND QUEUE OPERATIONS 1110 B.4.7
LIST OPERATIONS 1110 B.4.8 SIZE AND CAPACITY 1110
B.4.9 OTHER OPERATIONS 1111 B.4.1O ASSOCIATIVE CONTAINER OPERATIONS 1111
ALGORITHRNS 1112 B.5.1 NONMODIFYING SEQUENCE ALGORITHMS 1113
B.5.2 MODIFYING SEQUENCE ALGORITHMS 1114 B.5.3 UTILITY ALGORITHMS 1116
B.5.4 SORTING AND SEARCHING 1117 B.5.5 SET ALGORITHMS 1118
B.5.6 HEAPS 1119 B.5.7 PERMUTATIONS 1120 B.5.8 MIN AND MAX 1120 SN
UTILITICS 1121
B.6.1 INSERTERS 1121 B.6.2 FUNCTION OBJECTS 1122 B.6.3 PAIR 1123 1/0
STRCAMS 1124
B.7.1 1/0 STREAMS HIERARCHY 1126 B.7.2 ERROR HANDLING 1127 B.7.3 INPUT
OPERATIONS 1128 B.7.4 OUTPUT OPERATIONS 1128 B.7.5 FORMATTING 1129
B.7.6 STANDARD MANIPULATORS 1129 STRING MANIPULATION 1131 B.8.1
CHARACTER CLASSIFICATION 1131 B.8.2 STRING 1132
B.8.3 REGULAR EXPRESSION MATCHING 1133 NUMCRICS 1135 B.9.1
NUMERICALLIMITS 1135 B.9.2 STANDARD MATHEMATICAL FUNCTIONS 1137
B.9.3 COMPLEX 1138 B.9.4 VALARRAY 1139 B.9.5 GENERALIZED NUMERICAL
ALGORITHMS 1139
IMAGE 19
XXII CONTENTS
B.I0 C STANDARD LIBRARY FUNCTIONS 1140 B.10.1 FILES 1140 B.10.2 THE
PRINTFO FAMI1Y 1141 B.10.3 C-STYLE STRINGS 1145 B.10.4 MEMORY 1146
B.10.5 DATE AND TIME 1147 B.10.6 ETC. 1149 B.11 OTHER LIBRARIES 1150
APPENDIX C GETTING STARTED WITH VISUAL STUDIO 1151
G.L GETTING A PROGRAM TO RUN 1152 G.2 INSTALLING VISUAL STUDIO 1152 G.3
CREATING AND RUNNING A PROGRAM 1153 C.3.1 CREATE A NEW PROJECT 1153
C.3.2 USE THE STD_LIB_FACILITIES.H HEADER FILE 1153 C.3.3 ADD A C++
SOURCE FILE TO THE PROJECT 1154 C.3.4 ENTER YOUR SOURCE CODE 1154 C.3.5
BUILD AN EXECUTABLE PROGRAM 1154 C.3.6 EXECUTE THE PROGRAM 1155 C.3.7
SAVE THE PROGRAM 1155 G.4 LATER 1155
APPENDIX 0 INSTALLING FLTK 1157
D.1 INTRODUCTION 1158 D.2 DOWNLOADING FLTK 1158 D.3 INSTALLING FLTK 1159
D.4 USING FLTK IN VISUAL STUDIO 1159 D.5 TESTING IF IT ALL WORKED 1160
APPENDIX E GUI IMPLEMENTATION 1161
E.1 CALLBACK IMPLEMENTATION 1162 E.2 WIDGET IMPLEMENTATION 1163 E.3
WINDOW IMPLEMENTATION 1164 E.4 VECTOR_REF 1166 E.5 AN EXAMPLE:
MANIPULATING WIDGETS 1167
G/OSSARY 1171 BIBLIOGRAPHY 1177 INDEX 1181 |
any_adam_object | 1 |
any_adam_object_boolean | 1 |
author | Stroustrup, Bjarne 1950- |
author_GND | (DE-588)118044710 |
author_facet | Stroustrup, Bjarne 1950- |
author_role | aut |
author_sort | Stroustrup, Bjarne 1950- |
author_variant | b s bs |
building | Verbundindex |
bvnumber | BV035184990 |
callnumber-first | Q - Science |
callnumber-label | QA76 |
callnumber-raw | QA76.73.C153 |
callnumber-search | QA76.73.C153 |
callnumber-sort | QA 276.73 C153 |
callnumber-subject | QA - Mathematics |
classification_rvk | ST 230 ST 250 |
classification_tum | DAT 358f |
ctrlnum | (OCoLC)191927017 (DE-599)GBV566748606 |
dewey-full | 005.13/3 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005.13/3 |
dewey-search | 005.13/3 |
dewey-sort | 15.13 13 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
discipline_str_mv | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01544nam a2200409zc 4500</leader><controlfield tag="001">BV035184990</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20101207 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">081127s2009 xxuad|| |||| 00||| eng d</controlfield><datafield tag="010" ind1=" " ind2=" "><subfield code="a">2008032595</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9780321543721</subfield><subfield code="c">pbk. : alk. paper</subfield><subfield code="9">978-0-321-54372-1</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">0321543726</subfield><subfield code="9">0-321-54372-6</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)191927017</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)GBV566748606</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">aacr</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="044" ind1=" " ind2=" "><subfield code="a">xxu</subfield><subfield code="c">US</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-703</subfield><subfield code="a">DE-20</subfield><subfield code="a">DE-824</subfield><subfield code="a">DE-19</subfield><subfield code="a">DE-11</subfield><subfield code="a">DE-83</subfield><subfield code="a">DE-91G</subfield><subfield code="a">DE-861</subfield><subfield code="a">DE-898</subfield></datafield><datafield tag="050" ind1=" " ind2="0"><subfield code="a">QA76.73.C153</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005.13/3</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 230</subfield><subfield code="0">(DE-625)143617:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 358f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Stroustrup, Bjarne</subfield><subfield code="d">1950-</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)118044710</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Programming</subfield><subfield code="b">principles and practice using C++</subfield><subfield code="c">Bjarne Stroustrup</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Upper Saddle River, NJ [u.a.]</subfield><subfield code="b">Addison-Wesley</subfield><subfield code="c">2009</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXVIII, 1236 S.</subfield><subfield code="b">Ill., graph. Darst.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">C++ (Computer program language)</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">C++</subfield><subfield code="0">(DE-588)4193909-8</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">C++</subfield><subfield code="0">(DE-588)4193909-8</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">GBV Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=016991688&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-016991688</subfield></datafield></record></collection> |
id | DE-604.BV035184990 |
illustrated | Illustrated |
index_date | 2024-07-02T22:59:16Z |
indexdate | 2024-07-09T21:26:57Z |
institution | BVB |
isbn | 9780321543721 0321543726 |
language | English |
lccn | 2008032595 |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-016991688 |
oclc_num | 191927017 |
open_access_boolean | |
owner | DE-703 DE-20 DE-824 DE-19 DE-BY-UBM DE-11 DE-83 DE-91G DE-BY-TUM DE-861 DE-898 DE-BY-UBR |
owner_facet | DE-703 DE-20 DE-824 DE-19 DE-BY-UBM DE-11 DE-83 DE-91G DE-BY-TUM DE-861 DE-898 DE-BY-UBR |
physical | XXVIII, 1236 S. Ill., graph. Darst. |
publishDate | 2009 |
publishDateSearch | 2009 |
publishDateSort | 2009 |
publisher | Addison-Wesley |
record_format | marc |
spelling | Stroustrup, Bjarne 1950- Verfasser (DE-588)118044710 aut Programming principles and practice using C++ Bjarne Stroustrup Upper Saddle River, NJ [u.a.] Addison-Wesley 2009 XXVIII, 1236 S. Ill., graph. Darst. txt rdacontent n rdamedia nc rdacarrier C++ (Computer program language) C++ (DE-588)4193909-8 gnd rswk-swf C++ (DE-588)4193909-8 s DE-604 GBV Datenaustausch application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=016991688&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Stroustrup, Bjarne 1950- Programming principles and practice using C++ C++ (Computer program language) C++ (DE-588)4193909-8 gnd |
subject_GND | (DE-588)4193909-8 |
title | Programming principles and practice using C++ |
title_auth | Programming principles and practice using C++ |
title_exact_search | Programming principles and practice using C++ |
title_exact_search_txtP | Programming principles and practice using C++ |
title_full | Programming principles and practice using C++ Bjarne Stroustrup |
title_fullStr | Programming principles and practice using C++ Bjarne Stroustrup |
title_full_unstemmed | Programming principles and practice using C++ Bjarne Stroustrup |
title_short | Programming |
title_sort | programming principles and practice using c |
title_sub | principles and practice using C++ |
topic | C++ (Computer program language) C++ (DE-588)4193909-8 gnd |
topic_facet | C++ (Computer program language) C++ |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=016991688&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT stroustrupbjarne programmingprinciplesandpracticeusingc |