gogogo
Syndetics cover image
Image from Syndetics

Programming : principles and practice using C++ / Bjarne Stroustrup.

By: Material type: TextTextPublication 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)
Subject(s): DDC classification:
  • 005.133 STR
Contents:
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.
Holdings
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)

Excerpt provided by Syndetics

" Damn the torpedoes! Full speed ahead. " --Admiral Farragut Programming is the art of expressing solutions to problems so that a computer can execute those solutions. Much of the effort in programming is spent finding and refining solutions. Often, a problem is only fully understood through the process of programming a solution for it. This book is for someone who has never programmed before, but is willing to work hard to learn. It helps you acquire the principles and practical skills of programming using the C++ programming language. My aim is for you to gain sufficient knowledge and experience to perform simple useful programming tasks using the best up-to-date techniques. How long will that take? As part of a first-year university course, you can work through this book in a semester (assuming that you have a workload of four courses of average difficulty). If you work by yourself, don't expect to spend less time than that (maybe 15 hours a week for 14 weeks). Three months may seem a long time, but there's a lot to learn and you'll be writing your first simple programs after about an hour. Also, all learning is gradual: each chapter introduces new useful concepts and illustrates them with examples inspired by real-world uses. Your ability to express ideas in code -- getting a computer to do what you want it to do -- gradually and steadily increases as you go along. I never say "learn a month's worth of theory and then see if you can use it." Why would you want to program? Our civilization runs on software. Without understanding software you are reduced to believing in "magic" and will be locked out of many of the most interesting, profitable, and socially useful technical fields of work. When I talk about programming, I think of the whole spectrum of computer programs from personal computer applications with GUIs (Graphical User Interfaces), through engineering calculations and embedded system control applications (such as digital cameras, cars, and cell phones), to text manipulation applications as found in many humanities and business applications. Like mathematics, programming -- when done well -- is a valuable intellectual exercise that sharpens our ability to think. However, thanks to feedback from the computer, programming is more concrete than most forms of math, and therefore accessible to more people. It is a way to reach out and change the world -- hopefully for the better. Finally, programming can be great fun. Why C++? You can't learn to program without a programming language and C++ directly supports the key concepts and techniques used in real-world software. C++ is one of the most widely used programming languages, found in an unsurpassed range of application areas. You find C++ applications everywhere from the bottom of the oceans to the surface of Mars. C++ is precisely and comprehensively defined by a non-proprietary international standard. Quality and/or free implementations are available on every kind of computer. Most of the programming concepts that you will learn using C++ can be used directly in other languages, such as C, C#, Fortran, and Java. Finally, I simply like C++ as a language for writing elegant and efficient code. This is not the easiest book on beginning programming; it is not meant to be. I just aim for it to be the easiest book from which you can learn the basics of real-world programming. That's quite an ambitious goal because much modern software relies on techniques considered advanced just a few years ago. My fundamental assumption is that you want to write programs for the use of others, and to do so responsibly providing a decent level of system quality. That is, I assume that you want to achieve a level of professionalism. Consequently, I chose the topics for this book to cover what is needed to get started with real-world programming, not just what is easy to teach and learn. If you need a technique to get basic work done right, I'll describe it, demonstrate concepts and language facilities needed to support the technique, provide exercises for it, and expect you to work on those exercises. If you just want to understand toy programs, you can get along with far less than I present. On the other hand, I won't waste your time with material of marginal practical importance. If an idea is explained here, it's because you'll almost certainly need it. If your desire is to use the work of others without understanding how things are done and without adding significantly to the code yourself, this book is not for you. If so, please consider if you would be better served by another book and another language. If that is approximately your view of programming, please also consider from where you got that view and whether it in fact is adequate for your needs. People often underestimate the complexity of programming as well as its value. I would hate for you to acquire a dislike for programming because of a mismatch between what you needed and the part of the software reality I describe. There are many parts of the "Information Technology" world that do not require knowledge of programming. This book is aimed to serve those who do want to write nontrivial programs. Because of its structure and practical aims, this book can also be used as a second book on programming for someone who already knows a bit of C++ or for someone who programs in another language and wants to learn C++. If you fit into one of those categories, I refrain from guessing how long it will take you to read this book, but I do encourage you to do many of our exercises. This will help you to counteract the common problem of writing programs in older, familiar, styles rather than adopting newer techniques where these are more appropriate. If you have learned C++ in one of the more traditional ways, you'll find something surprising and useful before you reach Chapter 7. Unless your name is Stroustrup, what I discuss here is not "your father's C++." Programming is learned by writing programs. In this, programming is similar to other endeavors with a practical component. You cannot learn to swim, to play a musical instrument, or to drive a car just from reading a book -- you must practice. Nor can you learn to program without reading and writing lots of code. This book focuses on code examples closely tied to explanatory text and diagrams. You need those to understand the ideals, concepts, and principles of programming and to master the language constructs used to express them. That's essential, but by itself, it will not give you the practical skills of programming. For that, you need to do the exercises and get used to the tools for writing, compiling, and running programs. You need to make your own mistakes, and learn to correct them. There is no substitute for writing code. Besides, that's where the fun is! On the other hand, there is more to programming -- much more -- than following a few rules and reading the manual. This book is emphatically not focused on "the syntax of C++." Understanding the fundamental ideals, principles, and techniques is essence of a good programmer. Only well-designed code has a chance of becoming part of a correct, reliable, and maintainable system. Also, "the fundamentals" are what lasts: they will still be essential after today's languages and tools have evolved or been replaced. What about computer science, software engineering, information technology, etc.? Is that all programming? Of course not! Programming is one of the fundamental topics that underlie everything in computer-related fields and has a natural place in a balanced course of computer science. I provide brief introductions to key concepts and techniques of algorithms, data structures, user interfaces, data processing, and software engineering. However, this book is not a substitute for a thorough and balanced study of those topics. Code can be beautiful as well as useful. This book is written to help you see that, to understand what it means for code to be beautiful and to help you to acquire the principles and practical skills to create such code. Good luck with programming! A note to students Of the 1,000++ first-year students we have taught so far using drafts of this book at Texas A&M University, about 60% had programmed before and about 40% had never seen a line of code in their life. Most succeeded, so you can do it too. You don't have to read this book as part of a course. I assume that the book will be widely used for self study. However, whether you work your way through as part of a course or independently, try to work with others. Programming has an -- unfair -- reputation as a lonely activity. Most people work better and learn faster when they are part of a group with a common aim. Learning together and discussing problems with friends is not cheating! It is the most efficient -- as well as most pleasant -- way of making progress. If nothing else, working with friends forces you to articulate your ideas, which is just about the most efficient way of testing your understanding and making sure you remember. You don't actually have to personally discover the answer to every obscure language and programming environment problem. However, please don't cheat yourself by not doing the drills and a fair number of exercises (even if no teacher forces you to do them). Remember: programming is (among other things) a practical skill that you need to practice to master. If you don't write code (do several exercises for each chapter), reading this book will become a pointless theoretical exercise. Most students -- especially thoughtful good students -- face times where they wonder whether their hard work is worthwhile. When (not if) this happens to you, take a break, re-read the foreword, look at Chapter 1 ("Computers, People, and Programming") and Chapter 22 ("Ideals and History"). There, I try to articulate what I find exciting about programming and why I consider it a crucial tool for making a positive contribution to the world. If you wonder about my teaching philosophy and general approach, have a look at Chapter 0 ("Notes to the Reader"). You might find the weight of this book worrying, but it should reassure you that part of the reason for the heft is that I prefer to repeat an explanation or add an example rather than have you search for the one and only explanation. The other major part of the reason is that the last third of the book is "additional material" presented for you to explore only if you are interested in more information about a specific area of programming, such as embedded systems programming, text analysis, or numerical computation. And please don't be too impatient. Learning any major new and valuable skill takes time, and is worth it. A note to teachers No, this is not a traditional Computer Science 101 course. It is a book about how to construct working software. As such, it leaves out much of what a computer science student is traditionally exposed to (Turing completeness, state machines, discrete math, Chomsky grammars, etc.). Even hardware is ignored on the assumption that students have used computers in various ways since kindergarten. This book does not even try to mention most important CS topics. It is about programming (or more generally about how to develop software) and as such it goes into more detail about fewer topics than many traditional courses. It tries to do just one thing well and Computer Science is not a one-course topic. If this book/course is used as part of a computer science, computer engineering, electrical engineering (many of our first students were EE majors) information science, or whatever program, I expect it to be taught alongside other courses as part of a well-rounded introduction. Please read Chapter 0 ("Notes to the Reader") for an explanation of my teaching philosophy, general approach, etc. Please try to convey those ideas to your students along the way. Excerpted from Programming: Principles and Practice Using C++ by Bjarne Stroustrup All rights reserved by the original copyright owners. Excerpts are provided for display purposes only and may not be reproduced, reprinted or distributed without the written permission of the publisher.

Author notes provided by Syndetics

Bjarne Stroustrup is the designer and original implementer of C++, as well as the author of The C++ Programming Language, Fourth Edition (Addison-Wesley, 2013), and A Tour of C++ (Addison-Wesley, 2014) and many popular and academic publications. Dr. Stroustrup is a managing director at Morgan Stanley in New York City, as well as a visiting professor at Columbia University and a Research distinguished professor at Texas A&M University. He is a member of the U.S. National Academy of Engineering, an IEEE Fellow, and an ACM fellow. His research interests include distributed systems, design, programming techniques, software development tools, and programming languages.nbsp;He is actively involved in the ISO standardization of C++.

Powered by Koha