C++ Programmer's Notebook

C++ Programmer's Notebook

3 (3 ratings by Goodreads)
By (author)  , By (author) 

List price: US$29.99

Currently unavailable

Add to wishlist

AbeBooks may have this title (opens in new window).

Try AbeBooks

Description

A reference for programmers, presenting C++ from real working code in a visual, reader-friendly format. Chapters on areas such as variables, operators and expressions, arrays and strings, structures, input- output, and templates contain two-page entries on specific examples of code. Right-side pages picture the code and describe each key statement, with rules for use presented in tables, plus tips and tricks. Left-side pages offer more in-depth information.show more

Product details

  • Paperback | 528 pages
  • 177.8 x 226.06 x 10.16mm | 725.74g
  • Pearson Education (US)
  • Prentice Hall
  • Upper Saddle River, United States
  • English
  • 2nd edition
  • 0130887013
  • 9780130887016

Table of contents

Preface. 1. Working with Variables. Naming Variables. Using Variables. Boolean Variables. Integer Variables. Character Variables. Escape Sequences. Floating Point Variables. Inside Exponential Notation. Data Type Conversion. Assigning Values to Variables. Constants. Scope. Local Variables versus Global Variables. File and Class Scope. Storage Specifiers. Static. Register. Auto. Storage Specifier Rules.2. Working with Operators and Expressions. Expressions. Arithmetic Operators. The +=, -=, *=, /= Operators. The ++, -- Operators. Relational Operators. The == and != Operators. Logical Operators. Bitwise Operators. Bitwise AND. Bitwise OR. Bitwise XOR (exclusive OR). Bitwise NOT. The Shift Left Operator. The Shift Right Operator. ?-The Conditional Operator. An Introduction to Indirection. The Precedence Table. Working with Expressions.3. Working with Arrays and C-Style Strings. Arrays and Strings. Assigning Values to an Array. Multidimensional Arrays. Assigning Values to a Multidimensional Array. Allocating Arrays Using the new Operator. Allocating Multidimensional Arrays Using the new Operator. C-Style Strings. Copying One C-Style String to Another Using strcpy( ) and strncpy( ). Reading in a C-Style String Using gets( )and fgets( ). Reading a C-Style String from the Keyboard Using scanf( ). Reading a C-Style String from the Keyboard with the Extraction Operator. Reading a C-Style String from the Keyboard with get( ) and getline( ). Comparing Two C-Style Strings. Displaying a C-Style String with printf( ). Displaying a C-Style String with puts( ). Displaying a String with the Insertion Operator. Concatenating C-Style Strings with strcat( ) and strncat( ). Determining the Length of a C-Style String with strlen( ). Determining the Length of a Substring with strcspn( ). Determining the Length of a Substring with strspn( ). Locating a Character within a C-Style String Using strpbrk( ). Locating the First Occurrence of a Substring in a C-Style String with strstr( ). Dividing a C-Style String into Several Substrings Using strtok( ). C-Style Strings versus the String Types of the C++ Standard Library.4. Working with Structures. Structures. A Structure at Work. Running the Sample Program. Other Ways to Declare an Instance of a Structure. Assigning Values to Structure Members. Multiple Instances of Structures. Assigning Values to Multiple Instances. Structures within Structures. Passing Members of a Structure to a Function. Passing Members by Address. Passing a Structure to a Function. Passing a Structure to a Function by Reference. Functions Returning Structures. Unions. Enumerations. The typedef Declaration.5. Working with Functions. Anatomy of a C++ Program. The main( ) Function. How to Use a Function. Passing Arguments by Value. Passing Multiple Arguments. Passing Arguments Using Reference Variables. Passing Arguments to the main( ) Function. Returning Values. Building a Program Using Functions. Additional Function Facts. Program Statements. White Space Characters. Preprocessor Directives. More Preprocessor Directives. #define with Arguments. inline Function. #if, #else, #elif, #endif. #ifdef, #ifndef, #undef. Using Include Once Header Files. #line, #error, and #pragma.6. Working with Program Control. Program Control Statements. The if Statement. The if...else Statement. The ? Operator. Nested if. Multiple Conditions. The switch...case Statement. Tricks of the Trade. for Loop. More on for Loops. while Loop. do...while Loop. break. Continue. exit( ). goto.7. Working with Objects and Classes. Classes. Declaring an Instance of a Class. Hiding Data Using the Access Control Specifier. The Constructor. More on Initialization. The Destructor. The Copy Constructor. Defining a Function Member outside the Class Declaration.8. Working with Overloading. Overloading. Overloading a Unary Operator. Overloading a Binary Operator. Overloading the Input and Output Operators. Operators that Can and Cannot Be Overloaded.9. Working with Inheritance. Inheritance. Access Specifiers. More about Inheritance. Multiple Inheritance. Ambiguity in Multiple Inheritance. Containership Class. Levels of Inheritance.10. Working with Pointers. Pointers and References. More on Using Pointers. Incrementing Pointers. Decrementing Pointers. Pointer Math. An Array of Pointers. Pointer-to-a-Pointer. Pointer-to-a-Function. Tricks of the Trade.11. Working with Virtual and Friend Functions. Creating a Virtual Function. Virtual Destructors. Creating a Pure Virtual Function. More about Virtual Functions. Friend Functions. Creating a Friend Function from a Function Member Forward Reference of a Class. Friend Classes.12. Working with Keyboard Input and Screen Output. C-Style Keyboard Input and Screen Output. Reading a Character from the Keyboard without Echo Using getch( )and _getch( ). Displaying a Character on the Screen with putchar( ). Reading a String from the Keyboard with Less Overhead Using gets( ). Reading Input with Greater Control Using scanf( ). Reading Data with scanf( ). Limiting the Number of Characters Read. Specifying Input String Contents. Creating Your Own Separator. Displaying a String with Less Overhead Using puts( ). Displaying a String with Greater Control Using printf( ). Displaying a String with printf( ). Displaying an Integer with printf( ).13. Working with Files and Streams. File Input/Output and Opening and Closing a File. Mode Specifiers for the fopen( ) Function. Writing a Character to a File Using putc( )and fputc( ). Reading a Character from a File Using getc( ). Tricks of the Trade. Writing a String to a File Using fputs( ). Reading a String from a File Using fgets( ). Writing an Integer to a File Using putw( ). Reading an Integer from a File Using getw( ). Writing a Block of Data to a File Using fwrite( ). Reading a Block of Data from a File Using fread( ). Creating a Database File. Reading a Record. Writing Various Data Types to a File or a String Using fprintf( ) and sprintf( ). Reading Various Data Types from a File or a String Using fscanf( ) and sscanf( ). Moving to Specific Locations in a File Using fseek( ). Other File Manipulation Functions. Using a File in C++. Writing Information to a File Using C++. Reading a String from a File Using C++. Reading and Writing a Single Character to a File Using C++. Reading and Writing an Object to a File. Specify the File Mode in C++. Moving to Specific Locations in an Input Using File Using seekg( )and tellg( ). Moving to Specific Locations in an Output File Using seekp( ) and tellp( ). Reading and Writing to the Same File.14. Working with Memory Management. Computer Memory. Data in the Program Process Space. Storing Data on the Heap. Storing an Array of Objects on the Heap. Reallocating Heap Memory. Storing Data on the Heap Using the new Operator. Using a Dynamic Array. More on Dynamic Arrays.15. Working with Sorting and Searching Data. The Bubble Sort. Inside the Bubble Sort. The Selection Sort. Inside the Selection Sort. The Quick Sort. Inside the Quick Sort. The Sequential (Linear) Search. The Binary Search. A Closer Look at the Binary Search Routine. Using bsearch( ).16. Working with Data Structures. Linked Lists. Adding a Node to the End of a Linked List. Adding a Node to Maintain Sorted Order. Removing a Node from a Linked List. Linked List Operators. More on Linked List Operators. Stacks. Implementing a Stack as an Array. Implementing a Stack as a Linked List. Using a Linked List Stack. Queues. Implementing a Queue as an Array. Implementing a Queue as a Linked List. Using a Linked List Queue.17. Working with Templates. Templates. Using Template Functions with a Defined Type. Templates with Multiple Parameters. Class Templates. Template Class Friendships.18. Working with Assertions and Exceptions. Assertions. try, catch, and throw. More about try, catch, and throw. Functions that Throw Exceptions. Throwing Objects.Appendix A: A User-Defined String Class. Appendix B: Keeping Current. Appendix C: Programmer's Checklist. Appendix D: ASCII Codes. Index.show more

About Jim Keogh

JIM KEOGH is former chair of the E-Commerce Track at Columbia University, where he also teaches C++. He has developed advanced C++ computer systems for major Wall Street companies. He is author of several titles in Prentice Hall PTR's Programmer's Notebook Series, including the Windows Programming Programmer's Notebook. He is also on the graduate school faculty at Saint Peter's College in Jersey City, NJ. JOHN SHAPLEY GRAY is a Professor of Computer Science and Chair of Interactive Information Technology at the University of Hartford, West Hartford, CT, and the principal of Gray Software Development. As an educator and consultant, he has been involved with computers and software development for over 18 years. He is the author of Interprocess Communications in UNIX: The Nooks & Crannies.show more

Rating details

3 ratings
3 out of 5 stars
5 33% (1)
4 0% (0)
3 0% (0)
2 67% (2)
1 0% (0)
Book ratings by Goodreads
Goodreads is the world's largest site for readers with over 50 million reviews. We're featuring millions of their reader ratings on our book pages to help you find your new favourite book. Close X