Programming : principles and practice using C++ / Bjarne Stroustrup.
Material type: TextPublication details: Upper Saddle River, NJ : Addison-Wesley, [2014]Edition: Second editionDescription: xxxi, 1274 pages : illustrations (some color) ; 24 cmISBN:- 9780321992789 (pbk. : alk. paper)
- 0321992784 (pbk. : alk. paper)
- 005.133 STR
Item type | Current library | Call number | Copy number | Status | Date due | Barcode | |
---|---|---|---|---|---|---|---|
Standard Loan | Moylish Library Main Collection | 005.133 STR (Browse shelf(Opens below)) | 1 | Available | 39002100483230 |
Enhanced descriptions from Syndetics:
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.
Includes bibliographical references (pages 1223-1225) and index.
Notes to the reader. The structure of this book ; A philosophy of teaching and learning ; Programming and computer science ; Creativity and problem solving ; Request for feedback ; References ; Biographies: Bjarne Stroustrup ; Lawrence Pete Petersen. Computers, people, and programming. Introduction ; Software ; People ; Computer science ; Computers are everywhere ; Ideals for programmers. The basics. Hello, world!: Programs ; The classic first program ; Compilation ; Linking ; Programming environments -- Objects, types, and values: Input ; Variables ; Input and type ; Operations and operators ; Assignment and initialization ; Composite assignment operators ; Names ; Types and objects ; Type safety -- Computation: Computation ; Objectives and tools ; Expressions ; Statements ; Functions ; Vector ; Language features -- Errors: Introduction ; Sources of errors ; Compile-time errors ; Link-time errors ; Run-time errors ; Exceptions ; Logic errors ; Estimation ; Debugging ; Pre- and post- conditions ; Testing -- Writing a program: A problem ; Thinking about the program ; Back to the calculator! ; Grammars ; Turning a grammar into code ; Trying the first version ; Trying the second version ; Token streams ; Program structure -- Completing a program: Introduction ; Input and output ; Error handling ; Negative numbers ; Remainder: % ; Cleaning up the code ; Recovering from errors ; Variables -- Technicalities: functions, etc.: Technicalities ; Declarations and definitions ; Header files ; Scope ; Function call and return ; Order of evaluation ; Namespaces -- Technicalities: classes, etc.: User-defined types ; Classes and members ; Interface and implementation ; Evolving a class ; Enumerations ; Operator overloading ; Class interfaces ; The date class.
Input and output. Input and output streams: Input and output ; The I/O stream model ; Files ; Opening a file ; Reading and writing a file ; I/O error handling ; Reading a single value ; User-defined output operators ; User-defined input loop ; Reading a structured file -- Customizing input and output: Regularity and irregularity ; Output formatting ; File opening and positioning ; String streams ; Line-oriented input ; Character classification ; Using nonstandard separators ; And there is so much more -- A display model: Why graphics? ; A display model ; A first example ; Using a GUI library ; Coordinates ; Shapes ; Using shape primitives ; Getting this to run -- Graphics classes: Overview of graphics classes ; Point and line ; Lines ; Color ; Line_style ; Open_polyline ; Closed_polyline ; Polygon ; Rectangle ; Managing unnamed objects ; Text ; Circle ; Ellipse ; Marked_polyline ; Marks ; Mark ; Images -- Graphics class design: Design principles ; Shape ; Base and derived classes ; Benefits of object-oriented programming -- Graphing functions and data: Introduction ; Graphing simple functions ; Function ; Axis ; Approximation ; Graphing data -- Graphical user interfaces: User interface alternatives ; The next button ; A simple window ; Button and other widgets ; An example ; Control inversion ; Adding a menu ; Debugging GUI code.
Data and algorithms. Vector and free store: Introduction ; Vector basics ; Memory, addresses, and pointers ; Free store and pointers ; Destructors ; Access to elements ; Pointers to class objects ; Messing with types: void* and casts ; Pointers and references ; The this pointer -- Vectors and arrays: Introduction ; Initialization ; Copying ; Essential operations ; Access to vector elements ; Arrays ; Examples: palindrome -- Vector, templates, and exceptions: The problems ; Changing size ; Templates ; Range checking and exceptions ; Resources and exceptions -- Containers and iterators: Storing and processing data ; STL ideals ; Sequences and iterators ; Linked lists ; Generalizing vector yet again ; An example: simple text editor ; Vector, list, and string ; Adapting our vector to the STL ; Adapting built-in arrays to the STL ; Container overview -- Algorithms and maps: Standard library algorithms ; The simplest algorithm: find() ; The general search: find_if() ; Function objects ; Numerical algorithms ; Associative containers ; Copying ; Sorting and searching ; Container algorithms.
Broadening the view. Ideals and history: History, ideals, and professionalism ; Programming language history overview -- Text manipulation: Text ; Strings ; I/O streams ; Maps ; A problem ; The idea of regular expressions ; Searching with regular expressions ; Regular expression syntax -- Numerics: Introduction ; Size, precision, and overflow ; Arrays ; C-style multidimensional arrays ; The matrix library ; An example: solving linear equations ; Random numbers ; The standard mathematical functions ; Complex numbers ; References -- Embedded system programming: Embedded systems ; Basic concepts ; Memory management ; Addresses, pointers, and arrays ; Bits, bytes, and words ; Coding standards -- Testing: What we want ; Proofs ; Testing ; Design for testing ; Debugging ; Performance ; References -- The C programming language: C and C++: siblings ; Functions ; Minor language differences ; Free store ; C-style strings ; Input/output: stdio ; Constants and macros ; Macros ; An example: intrusive containers.
Appendices. Language summary: General ; Literals ; Identifiers ; Scope, storage class, and lifetime ; Expressions ; Statements ; Declarations ; Built-in types ; Functions ; User-defined types ; Enumerations ; Classes ; Templates ; Exceptions ; Namespaces ; Aliases ; Preprocessor directives -- Standard library summary: Overview ; Error handling ; Iterators ; Containers ; Algorithms ; STL utilities ; I/O streams ; String manipulation ; Numerics ; Time ; C standard library functions ; Other libraries -- Getting started with Visual Studio: Getting a program to run ; Installing Visual Studio ; Creating and running a program ; Later -- Installing FLTK: Introduction ; Downloading FLTK ; Installing FLTK ; Using FLTK in Visual Studio ; Testing if it all worked -- GUI implementation: Callback implementation ; Widget implementation ; Window implementation ; Vector_ref ; An example: manipulating widgets.
Table of contents provided by Syndetics
- Preface (p. xxv)
- Chapter 0 Notes to the Reader (p. 1)
- 0.1 The structure of this book (p. 2)
- 0.2 A philosophy of teaching and learning (p. 6)
- 0.3 Programming and computer science (p. 12)
- 0.4 Creativity and problem solving (p. 12)
- 0.5 Request for feedback (p. 12)
- 0.6 References (p. 13)
- 0.7 Biographies (p. 13)
- Chapter 1 Computers, People, and Programming (p. 17)
- 1.1 Introduction (p. 18)
- 1.2 Software (p. 19)
- 1.3 People (p. 21)
- 1.4 Computer science (p. 24)
- 1.5 Computers are everywhere (p. 25)
- 1.6 Ideals for programmers (p. 34)
- Part I The Basics (p. 41)
- Chapter 2 Hello, World¡ (p. 43)
- 2.1 Programs (p. 44)
- 2.2 The classic first program (p. 45)
- 2.3 Compilation (p. 47)
- 2.4 Linking (p. 51)
- 2.5 Programming environments (p. 52)
- Chapter 3 Objects, Types, and Values (p. 59)
- 3.1 Input (p. 60)
- 3.2 Variables (p. 62)
- 3.3 Input and type (p. 64)
- 3.4 Operations and operators (p. 66)
- 3.5 Assignment and initialization (p. 69)
- 3.6 Composite assignment operators (p. 73)
- 3.7 Names (p. 74)
- 3.8 Types and objects (p. 77)
- 3.9 Type safety (p. 78)
- Chapter 4 Computation (p. 89)
- 4.1 Computation (p. 90)
- 4.2 Objectives and tools (p. 92)
- 4.3 Expressions (p. 94)
- 4.4 Statements (p. 100)
- 4.4.1 Selection (p. 102)
- 4.4.2 Iteration (p. 109)
- 4.5 Functions (p. 113)
- 4.6 vector (p. 117)
- 4.7 Language features (p. 125)
- Chapter 5 Errors (p. 133)
- 5.1 Introduction (p. 134)
- 5.2 Sources of errors (p. 136)
- 5.3 Compile-time errors (p. 136)
- 5.4 Link-time errors (p. 139)
- 5.5 Run-time errors (p. 140)
- 5.6 Exceptions (p. 146)
- 5.7 Logic errors (p. 154)
- 5.8 Estimation (p. 157)
- 5.9 Debugging (p. 158)
- 5.10 Pre- and post-conditions (p. 163)
- 5.11 Testing (p. 166)
- Chapter 6 Writing a Program (p. 173)
- 6.1 A problem (p. 174)
- 6.2 Thinking about the problem (p. 175)
- 6.3 Back to the calculator¡ (p. 178)
- 6.4 Grammars (p. 188)
- 6.5 Turning a grammar into code (p. 195)
- 6.6 Trying the first version (p. 203)
- 6.7 Trying the second version (p. 208)
- 6.8 Token streams (p. 209)
- 6.9 Program structure (p. 215)
- Chapter 7 Completing a Program (p. 221)
- 7.1 Introduction (p. 222)
- 7.2 Input and output (p. 222)
- 7.3 Error handling (p. 224)
- 7.4 Negative numbers (p. 229)
- 7.5 Remainder: % (p. 230)
- 7.6 Cleaning up the code (p. 232)
- 7.7 Recovering from errors (p. 239)
- 7.8 Variables (p. 242)
- Chapter 8 Technicalities: Functions, etc (p. 255)
- 8.1 Technicalities (p. 256)
- 8.2 Declarations and definitions (p. 257)
- 8.3 Header files (p. 264)
- 8.4 Scope (p. 266)
- 8.5 Function call and return (p. 272)
- 8.6 Order of evaluation (p. 291)
- 8.7 Namespaces (p. 294)
- Chapter 9 Technicalities: Classes, etc (p. 303)
- 9.1 User-defined types (p. 304)
- 9.2 Classes and members (p. 305)
- 9.3 Interface and implementation (p. 306)
- 9.4 Evolving a class (p. 308)
- 9.5 Enumerations (p. 318)
- 9.6 Operator overloading (p. 321)
- 9.7 Class interfaces (p. 323)
- 9.8 The Date class (p. 334)
- Part II Input and Output (p. 343)
- Chapter 10 Input and Output Streams (p. 345)
- 10.1 Input and output (p. 346)
- 10.2 The I/O stream model (p. 347)
- 10.3 Files (p. 349)
- 10.4 Opening a file (p. 350)
- 10.5 Reading and writing a file (p. 352)
- 10.6 I/O error handling (p. 354)
- 10.7 Reading a single value (p. 358)
- 10.8 User-defined output operators (p. 363)
- 10.9 User-defined input operators (p. 365)
- 10.10 A standard input loop (p. 365)
- 10.11 Reading a structured file (p. 367)
- Chapter 11 Customizing Input and Output (p. 379)
- 11.1 Regularity and irregularity (p. 380)
- 11.2 Output formatting (p. 380)
- 11.3 File opening and positioning (p. 388)
- 11.4 String streams (p. 394)
- 11.5 Line-oriented input (p. 395)
- 11.6 Character classification (p. 396)
- 11.7 Using nonstandard separators (p. 398)
- 11.8 And there is so much more (p. 406)
- Chapter 12 A Display Model (p. 411)
- 12.1 Why graphics? (p. 412)
- 12.2 A display model (p. 413)
- 12.3 A first example (p. 414)
- 12.4 Using a GUI library (p. 418)
- 12.5 Coordinates (p. 419)
- 12.6 Shapes (p. 420)
- 12.7 Using Shape primitives (p. 421)
- 12.8 Getting this to run (p. 435)
- Chapter 13 Graphics Classes (p. 441)
- 13.1 Overview of graphics classes (p. 442)
- 13.2 Point and Line (p. 444)
- 13.3 Lines (p. 447)
- 13.4 Color (p. 450)
- 13.5 Line_style (p. 452)
- 13.6 Open_polyline (p. 455)
- 13.7 Closed_polyline (p. 456)
- 13.8 Polygon (p. 458)
- 13.9 Rectangle (p. 460)
- 13.10 Managing unnamed objects (p. 465)
- 13.11 Text (p. 467)
- 13.12 Circle (p. 470)
- 13.13 Ellipse (p. 472)
- 13.14 Marked_polyline (p. 474)
- 13.15 Marks (p. 476)
- 13.16 Mark (p. 478)
- 13.17 Images (p. 479)
- Chapter 14 Graphics Class Design (p. 487)
- 14.1 Design principles (p. 488)
- 14.2 Shape (p. 493)
- 14.3 Base and derived classes (p. 504)
- 14.4 Benefits of object-oriented programming (p. 513)
- Chapter 15 Graphing Functions and Data (p. 519)
- 15.1 Introduction (p. 520)
- 15.2 Graphing simple functions (p. 520)
- 15.3 Function (p. 524)
- 15.4 Axis (p. 529)
- 15.5 Approximation (p. 532)
- 15.6 Graphing data (p. 537)
- Chapter 16 Graphical User Interfaces (p. 551)
- 16.1 User interface alternatives (p. 552)
- 16.2 The "Next" button (p. 553)
- 16.3 A simple window (p. 554)
- 16.4 Button and other Widgets (p. 561)
- 16.5 An example (p. 565)
- 16.6 Control inversion (p. 569)
- 16.7 Adding a menu (p. 570)
- 16.8 Debugging GUI code (p. 575)
- Part III Data and Algorithms (p. 581)
- Chapter 17 Vector and Free Store (p. 583)
- 17.1 Introduction (p. 584)
- 17.2 vector basics (p. 586)
- 17.3 Memory, addresses, and pointers (p. 588)
- 17.4 Free store and pointers (p. 591)
- 17.5 Destructors (p. 601)
- 17.6 Access to elements (p. 605)
- 17.7 Pointers to class objects (p. 606)
- 17.8 Messing with types: void* and casts (p. 608)
- 17.9 Pointers and references (p. 610)
- 17.10 The this pointer (p. 618)
- Chapter 18 Vectors and Arrays (p. 627)
- 18.1 Introduction (p. 628)
- 18.2 Initialization (p. 629)
- 18.3 Copying (p. 631)
- 18.4 Essential operations (p. 640)
- 18.5 Access to vector elements (p. 646)
- 18.5.1 Overloading on const (p. 647)
- 18.6 Arrays (p. 648)
- 18.7 Examples: palindrome (p. 659)
- Chapter 19 Vector, Templates, and Exceptions (p. 667)
- 19.1 The problems (p. 668)
- 19.2 Changing size (p. 671)
- 19.3 Templates (p. 678)
- 19.4 Range checking and exceptions (p. 693)
- 19.5 Resources and exceptions (p. 697)
- Chapter 20 Containers and Iterators (p. 711)
- 20.1 Storing and processing data (p. 712)
- 20.2 STL ideals (p. 717)
- 20.3 Sequences and iterators (p. 720)
- 20.4 Linked lists (p. 724)
- 20.5 Generalizing vector yet again (p. 729)
- 20.6 An example: a simple text editor (p. 734)
- 20.7 vector, list, and string (p. 741)
- 20.8 Adapting our vector to the STL (p. 745)
- 20.9 Adapting built-in arrays to the STL (p. 747)
- 20.10 Container overview (p. 749)
- Chapter 21 Algorithms and Maps (p. 757)
- 21.1 Standard library algorithms (p. 758)
- 21.2 The simplest algorithm: find() (p. 759)
- 21.3 The general search: find_if() (p. 763)
- 21.4 Function objects (p. 765)
- 21.5 Numerical algorithms (p. 770)
- 21.6 Associative containers (p. 776)
- 21.7 Copying (p. 789)
- 21.8 Sorting and searching (p. 794)
- 21.9 Container algorithms (p. 797)
- Part IV Broadening the View (p. 803)
- Chapter 22 Ideals and History (p. 805)
- 22.1 History, ideals, and professionalism (p. 806)
- 22.2 Programming language history overview (p. 818)
- Chapter 23 Text Manipulation (p. 849)
- 23.1 Text (p. 850)
- 23.2 Strings (p. 850)
- 23.3 I/O streams (p. 855)
- 23.4 Maps (p. 855)
- 23.5 A problem (p. 864)
- 23.6 The idea of regular expressions (p. 866)
- 23.7 Searching with regular expressions (p. 869)
- 23.8 Regular expression syntax (p. 872)
- 23.9 Matching with regular expressions (p. 880)
- 23.10 References (p. 885)
- Chapter 24 Numerics (p. 889)
- 24.1 Introduction (p. 890)
- 24.2 Size, precision, and overflow (p. 890)
- 24.3 Arrays (p. 895)
- 24.4 C-style multidimensional arrays (p. 896)
- 24.5 The Matrix library (p. 897)
- 24.6 An example: solving linear equations (p. 908)
- 24.7 Random numbers (p. 914)
- 24.8 The standard mathematical functions (p. 917)
- 24.9 Complex numbers (p. 919)
- 24.10 References (p. 920)
- Chapter 25 Embedded Systems Programming (p. 925)
- 25.1 Embedded systems (p. 926)
- 25.2 Basic concepts (p. 929)
- 25.3 Memory management (p. 935)
- 25.4 Addresses, pointers, and arrays (p. 943)
- 25.5 Bits, bytes, and words (p. 954)
- 25.6 Coding standards (p. 974)
- Chapter 26 Testing (p. 989)
- 26.1 What we want (p. 990)
- 26.2 Proofs (p. 992)
- 26.3 Testing (p. 992)
- 26.4 Design for testing (p. 1011)
- 26.5 Debugging (p. 1012)
- 26.6 Performance (p. 1012)
- 26.7 References (p. 1016)
- Chapter 27 The C Programming Language (p. 1021)
- 27.1 C and C++: siblings (p. 1022)
- 27.2 Functions (p. 1028)
- 27.3 Minor language differences (p. 1036)
- 27.4 Free store (p. 1043)
- 27.5 C-style strings (p. 1045)
- 27.6 Input/output: stdio (p. 1050)
- 27.7 Constants and macros (p. 1054)
- 27.8 Macros (p. 1055)
- 27.9 An example: intrusive containers (p. 1059)
- Part V Appendices (p. 1071)
- Appendix A Language Summary (p. 1073)
- A.1 General (p. 1074)
- A.2 Literals (p. 1077)
- A.3 Identifiers (p. 1081)
- A.4 Scope, storage class, and lifetime (p. 1082)
- A.5 Expressions (p. 1086)
- A.6 Statements (p. 1096)
- A.7 Declarations (p. 1098)
- A.8 Built-in types (p. 1099)
- A.9 Functions (p. 1103)
- A.10 User-defined types (p. 1106)
- A.11 Enumerations (p. 1107)
- A.12 Classes (p. 1108)
- A.13 Templates (p. 1121)
- A.14 Exceptions (p. 1125)
- A.15 Namespaces (p. 1127)
- A.16 Aliases (p. 1128)
- A.17 Preprocessor directives (p. 1128)
- Appendix B Standard Library Summary (p. 1131)
- B.1 Overview (p. 1132)
- B.2 Error handling (p. 1137)
- B.3 Iterators (p. 1139)
- B.4 Containers (p. 1144)
- B.5 Algorithms (p. 1152)
- B.6 STL utilities (p. 1162)
- B.7 I/O streams (p. 1168)
- B.8 String manipulation (p. 1175)
- B.9 Numerics (p. 1180)
- B.10 Time (p. 1185)
- B.11 C standard library functions (p. 1185)
- B.12 Other libraries (p. 1195)
- Appendix C Getting Started with Visual Studio (p. 1197)
- C.1 Getting a program to run (p. 1198)
- C.2 Installing Visual Studio (p. 1198)
- C.3 Creating and running a program (p. 1199)
- C.4 Later (p. 1201)
- Appendix D Installing FLTK (p. 1203)
- D.1 Introduction (p. 1204)
- D.2 Downloading FLTK (p. 1204)
- D.3 Installing FLTK (p. 1205)
- D.4 Using FLTK in Visual Studio (p. 1205)
- D.5 Testing if it all worked (p. 1206)
- Appendix E: GUI Implementation (p. 1207)
- E.1 Callback implementation (p. 1208)
- E.2 Widget implementation (p. 1209)
- E.3 Window implementation (p. 1210)
- E.4 Vector_ref (p. 1212)
- E.5 An example: manipulating Widgets (p. 1213)
- Glossary (p. 1217)
- Bibliography (p. 1223)
- Index (p. 1227)