20%
41.90
CHF33.50
Download est disponible immédiatement
An Introduction to Programming by the Inventor of C++
Preparation for Programming in the Real World
The book assumes that you aim eventually to write non-trivial programs, whether for work in software development or in some other technical field.
Focus on Fundamental Concepts and Techniques
The book explains fundamental concepts and techniques in greater depth than traditional introductions. This approach will give you a solid foundation for writing useful, correct, maintainable, and efficient code.
Programming with Today's C++ (C++11 and C++14)
The book is an introduction to programming in general, including object-oriented programming and generic programming. It is also a solid introduction to the C++ programming language, one of the most widely used languages for real-world software. The book presents modern C++ programming techniques from the start,
introducing the C++ standard library and C++11 and C++14 features to simplify programming tasks.
For Beginners-And Anyone Who Wants to Learn Something New
The book is primarily designed for people who have never programmed before, and it has been tested with many thousands of first-year university students. It has also been extensively used for self-study. Also, practitioners and advanced students have gained new insight and guidance by seeing how a master approaches the elements of his art.
Provides a Broad View
The first half of the book covers a wide range of essential concepts, design and programming techniques, language features, and libraries. Those will enable you to write programs involving input, output, computation, and simple graphics. The second half explores more specialized topics (such as text processing, testing, and the C programming language) and provides abundant reference material. Source code and support supplements are available from the author's website.
Auteur
Bjarne Stroustrup is the designer and original implementer of C++ and the author of Programming: Principles and Practice Using C++, 2nd Edition and The C++ Programming Language, among others. Having previously worked at Bell Labs, AT&T Labs - Research, and Texas A&M University, he is currently Managing Director in the technology division of Morgan Stanley in New York City. The recipient of numerous honors, including The National Academy of Engineering 2018 Charles Stark Draper Prize for Engineering "for conceptualizing and developing the C++ programming language, Dr. Stroustrup is a member of the National Academy of Engineering, an AT&T Fellow, an AT&T Bell Laboratories Fellow, an IEEE Fellow, and an ACM Fellow. He was voted into Electronic Design's Engineering Hall of Fame in 2013. His research interests include distributed systems, simulation, design, programming techniques, software development tools, and programming languages, and he remains actively involved in the ANSI/ISO standardization of C++. Dr. Stroustrup holds an advanced degree from the University of Aarhus in his native Denmark and a Ph.D. in Computer Science from Cambridge University, England
Contenu
Preface xxv
Chapter 0: Notes to the Reader 1
0.1 The structure of this book 2
0.2 A philosophy of teaching and learning 6
0.3 Programming and computer science 12
0.4 Creativity and problem solving 12
0.5 Request for feedback 12
0.6 References 13
0.7 Biographies 13
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.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.6 Composite assignment operators 73
3.7 Names 74
3.8 Types and objects 77
3.9 Type safety 78
Chapter 4: Computation 89
4.1 Computation 90
4.2 Objectives and tools 92
4.3 Expressions 94
4.4 Statements 100
4.4.1 Selection 102
4.4.2 Iteration 109
4.5 Functions 113
4.6 vector 117
4.7 Language features 125
Chapter 5: Errors 133
5.1 Introduction 134
5.2 Sources of errors 136
5.3 Compile-time errors 136
5.4 Link-time errors 139
5.5 Run-time errors 140
5.6 Exceptions 146
5.7 Logic errors 154
5.8 Estimation 157
5.9 Debugging 158
5.10 Pre- and post-conditions 163
5.11 Testing 166
Chapter 6: Writing a Program 173
6.1 A problem 174
6.2 Thinking about the problem 175
6.3 Back to the calculator! 178
6.4 Grammars 188
6.5 Turning a grammar into code 195
6.6 Trying the first version 203
6.7 Trying the second version 208
6.8 Token streams 209
6.9 Program structure 215
Chapter 7: Completing a Program 221
7.1 Introduction 222
7.2 Input and output 222
7.3 Error handling 224
7.4 Negative numbers 229
7.5 Remainder: % 230
7.6 Cleaning up the code 232
7.7 Recovering from errors 239
7.8 Variables 242
Chapter 8: Technicalities: Functions, etc. 255
8.1 Technicalities 256
8.2 Declarations and definitions 257
8.3 Header files 264
8.4 Scope 266
8.5 Function call and return 272
8.6 Order of evaluation 291
8.7 Namespaces 294
Chapter 9: Technicalities: Classes, etc. 303
9.1 User-defined types 304
9.2 Classes and members 305
9.3 Interface and implementation 306
9.4 Evolving a class 308
9.5 Enumerations 318
9.6 Operator overloading 321
9.7 Class interfaces 323
9.8 The Date class 334
Part II Input and Output 343
Chapter 10: Input and Output Streams 345
10.1 Input and output 346
10.2 The I/O stream model 347
10.3 Files 349
10.4 Opening a file 350
10.5 Reading and writing a file 352
10.6 I/O error handling 354
10.7 Reading a single value 358
10.8 User-defined output operators 363
10.9 User-defined input operators 365
10.10 A standard input loop 365
10.11 Reading a structured file 367
Chapter 11: Customizing Input and Output 379
11.1 Regularity and irregularity 380
11.2 Output formatting 380
11.3 File opening and positioning 388
11.4 String streams 394
11.5 Line-oriented input 395
11.6 Character classification 396
11.7 Using nonstandard separators 398
11.8 And there is so much more 406
Chapter 12: A Display Model 411
12.1 Why graphics? 412
12.2 A display model 413
12.3 A first example 414
12.4 Using a GUI library 418
12.5 Coordinates 419
12.6 Shapes 420
12.7 Using Shape primitives 421
12.8 Getting this to run 435
Chapter 13: Graphics Classes 441
13.1 Overview of graphics classes 442
13.2 Point and Line 444
13.3 Lines 447
13.4 Color 450
13.5 Line_style 452
13.6 Open_polyline 455
13.7 Closed_polyline 456
13.8 Polygon 458
13.9 Rectangle 460
13.10 Managing unnamed objects 465
13.11 Text 467
13.12 Circle 470
13.13 Ellipse 472
13.14 Marked_polyline 474
13.15 Marks 476
13.16 Mark 478
13.17 Images 479
Chapter 14: Graphics Class Design 487
14.1 Design principles 488
14.2 Shape 493
14.3 Base and derived classes 504
14.4 Benefits of object-oriented programming 513
Chapter 15: Graphing Functions and Data 519
15.1 Introduction 520
15.2 Graphing simple functions 520
15.3 Function 524
15.4 Axis 529
15.5 Approximation 532
15.6 Graphing data 537
Chapter 16: Graphical User Interfaces 551
16.1 User interface alternatives 552
16.2 The "Next" button 553
16.3 A simple window 554
16.4 Button and other Widgets 561
16.5 An example 565
16.6 Control inversion 569
16.7 Adding a menu 570
16.8 Debugging GUI code 575
Part III: Data and Algorithms 581
Chapter 17: Vector and Free Store 583
17.1 Introduction 584
17.2 ve…