Coverart for item
The Resource Cybernetics in C++, (electronic resource)

Cybernetics in C++, (electronic resource)

Label
Cybernetics in C++
Title
Cybernetics in C++
Creator
Contributor
Language
eng
Member of
Cataloging source
NhCcYBP
http://library.link/vocab/creatorName
Bhattacharyya, Avi
Dewey number
005.133
Index
no index present
LC call number
Q310
LC item number
.B438 2018
Literary form
non fiction
Nature of contents
dictionaries
http://library.link/vocab/relatedWorkOrContributorName
ProQuest (Firm)
Series statement
River Publishers Series in Software Engineering Ser
Label
Cybernetics in C++, (electronic resource)
Instantiates
Publication
Note
  • Description based upon print version of record
  • 4. PROGRAMMING PRACTICE
Contents
  • Hello World
  • Post Increment
  • 2.4.1.3.2.
  • Pre Increment
  • 2.4.1.3.3.
  • Similarities & Differences: Pre Increment & Post Increment
  • 2.4.1.4.
  • Bitwise Operators
  • 2.4.2.
  • Logical Operators
  • 2.4.3.
  • 1.3.
  • Sizeof Operator
  • 3.
  • Control Statements
  • 3.1.
  • Conditional Statements
  • 3.1.1.
  • If Statements
  • 3.1.1.1.
  • What is a condition?
  • 3.1.2.
  • Writing C++ Source Code
  • if, Then, Else Clause
  • 3.1.2.1.
  • Alternative Form using the Ternary? : Operator
  • 3.1.3.
  • Cascaded/Nested if Statements
  • 3.1.4.
  • if, Else if, Else Clause
  • 3.1.5.
  • Switch Statement
  • 3.1.6.
  • 1.3.1.
  • Switch Statement vs if, Else if, Else Clause
  • 3.2.
  • Problem Solving with Loops
  • 3.2.1.
  • What are Loops?
  • 3.2.2.
  • For Loop
  • 3.2.3.
  • While Loop
  • 3.2.3.1.
  • Comments
  • Empty While Loop
  • 3.2.4.
  • Do Loop/While Loop
  • 3.3.
  • C++ Statements & Constructs
  • 3.3.1.
  • Blocks
  • 3.3.2.
  • Break Statement
  • 3.3.3.
  • 1.3.1.1.
  • Continue Statement
  • 3.3.4.
  • Goto Statement
  • 3.3.4.1.
  • Prospective Evils of the goto statement
  • 3.3.5.
  • Dropping the Braces 0 For 1 Action
  • 3.3.5.1.
  • Potential Hazards in dropping the Braces
  • 3.3.5.1.1.
  • Style with Primitive Tools
  • Breaking at the Wrong Place
  • 3.3.5.1.2.
  • Dangling Else Clause Issue
  • 3.3.5.2.
  • Guideline with Braces
  • 3.4.
  • Creating Aliases IN C & C++
  • 3.4.1.
  • Defining Constants Using #Define - Avoid in C++
  • 3.4.1.1.
  • 1.3.2.
  • Issues with Macro Aliases
  • 3.4.2.
  • Typedef
  • 3.4.2.1.
  • Cannot modify Typedef
  • 4.
  • Programming Practice
  • 4.1.
  • Good vs Bad Practices
  • 4.2.
  • Source Code Files
  • Guidelines
  • 4.2.1.
  • Organisation
  • 4.2.2.
  • Naming of Variables
  • 4.2.3.
  • Formatting of Source Code
  • 4.3.
  • Debugging
  • 4.3.1.
  • 1.4.
  • Breakpoints
  • 4.3.2.
  • Viewing Variables
  • 4.3.3.
  • Single Stepping
  • 5.
  • Functions
  • 5.1.
  • Procedural Thinking
  • 5.1.1.
  • Machine generated contents note:
  • Subsequent Stages in Building a Program
  • Procedural Thinking Outside the Programming World
  • 5.1.2.
  • Procedural Thinking Inside the Programming World
  • 5.2.
  • What are Functions?
  • 5.2.1.
  • Function Naming
  • 5.2.2.
  • Function Definitions
  • 5.2.3.
  • 1.4.1.
  • Function Declarations
  • 5.2.3.1.
  • Signature of a Function (1)
  • 5.2.4.
  • Function Invocation
  • 5.2.4.1.
  • Caution: Circular Reference
  • 5.2.5.
  • Declarations vs Definitions
  • 5.3.
  • Compilation
  • Functions: No Inputs, No Output
  • 5.4.
  • Functions: Some Inputs, No Output
  • 5.4.1.
  • Signature of a Function (2)
  • 5.4.2.
  • Formal Parameters vs. Actual Parameters
  • 5.4.3.
  • Passing a Copy of the Value
  • 5.4.4.
  • 1.4.1.1.
  • No Predetermined Order of Evaluation of Actual Parameters
  • 5.4.5.
  • Modifying Formal Parameters
  • 5.4.5.1.
  • Default Values
  • 5.4.5.2.
  • Const Formal Parameters
  • 5.5.
  • Functions: Some Inputs, an output
  • 5.5.1.
  • Object Files
  • Returning a Value
  • 5.6.
  • Main Function
  • 5.7.
  • Scope of a Variable
  • 5.7.1.
  • Global Variables
  • 5.7.1.1.
  • Prospective Evils of Global Variables
  • 5.7.2.
  • 1.4.2.
  • Local Variables
  • 5.7.2.1.
  • Automatic Local Variables
  • 5.7.2.2.
  • Static Local Variables
  • 5.7.2.2.1.
  • Initialising Static Local Variables
  • 5.7.2.2.2.
  • Caution with Static Local Variables
  • 5.8.
  • Linking
  • Debugging: Single Step In
  • 5.8.1.
  • Debug/Call Stack
  • 5.9.
  • Overloading Functions
  • 5.9.1.
  • Prospective Evils of Function Overloading
  • 6.
  • Inline Functions and Macros
  • 6.1.
  • 1.4.3.
  • Function Invocation Overhead
  • 6.2.
  • C Macros - For the Best Part Avoid in C++
  • 6.2.1.
  • Creating a Macro
  • 6.2.2.
  • Conditional Preprocessor Directives
  • 6.2.2.1.
  • #ifdef, #ifndef #endif Clause
  • 6.2.3.
  • Running
  • Prospective Evils of Macros
  • 6.2.3.1.
  • Losing Track of Types
  • 6.2.3.2.
  • Losing Track of the Name
  • 6.2.3.3.
  • Operator Precedence Problems
  • 6.2.4.
  • Rules of Thumb with Macros
  • 6.3.
  • 1.5.
  • Inline Functions
  • 6.3.1.
  • Defining & Declaring Inline Functions
  • 6.3.2.
  • Using Inline Functions
  • 6.3.3.
  • Inline Keyword: A Request, Not an Instruction
  • 6.3.4.
  • Macro Problems not Manifest in Inline Functions
  • 7.
  • 1.
  • Debugging (1)
  • Program Management Over Multiple Files
  • 7.1.
  • Software Projects
  • 7.1.1.
  • Source Code
  • 7.2.
  • Building C++ Projects
  • 7.2.1.
  • Compilation
  • 7.2.2.
  • 1.5.1.
  • Linking
  • 7.3.
  • Controlling Visibility
  • 7.3.1.
  • Creating External Visibility Using Extern
  • 7.3.1.1.
  • Linker Error caused by a Lack of Definition
  • 7.3.2.
  • Hiding External Visibility Using Static
  • 7.3.2.1.
  • What are Bugs/Errors?
  • Duplication of the keyword static
  • 7.4.
  • Namespaces
  • 7.5.
  • Potential Problem: Multiple Inclusions
  • 7.6.
  • Preventing Multiple Inclusions
  • 7.6.1.
  • Ensuring Single Inclusions Using Macros
  • 7.6.1.1.
  • 1.5.2.
  • Using #ifndef to prevent Multiple Inclusions
  • 7.6.2.
  • Ensuring Single Inclusions Using Preprocessor Directives
  • 8.
  • Recursion
  • 8.1.
  • What is Recursion?
  • 8.1.1.
  • Recursion Outside the Programming World
  • 8.1.2.
  • Compile-Time Errors
  • Recursion Inside the Programming World
  • 8.2.
  • Caution with Recursion
  • 8.3.
  • Computing Factorials
  • 8.3.1.
  • Iterative Algorthm: Using Loops
  • 8.3.2.
  • Using Recursion
  • 8.4.
  • 1.5.2.1.
  • Fibonacci Sequence
  • 8.4.1.
  • Applications of the Fibonacci Sequence
  • 8.5.
  • Generating Permutations
  • 8.5.1.
  • Recursive
  • 8.5.2.
  • Next Permutation Algorithm
  • 8.6.
  • Compiler Errors
  • Hanoi Towers
  • 8.6.1.
  • Strategy for 3 Rings
  • 8.6.2.
  • Strategy for 4 Rings
  • 8.6.3.
  • Iterative Strategies
  • 8.6.4.
  • Recursive Strategies
  • 8.6.5.
  • 1.5.2.2.
  • Implementing Recursion in Hanoi Towers
  • 8.6.6.
  • Traditional Legends of Hanoi Towers
  • 8.7.
  • Further Recursive Problems
  • 8.7.1.
  • Triangular Numbers
  • 8.7.2.
  • Knapsack/Rucksack Problem
  • 8.7.3.
  • Compiler Warning
  • N Queens Problem
  • 9.
  • Arrays
  • 9.1.
  • What are Arrays?
  • 9.1.1.
  • Homogeneous Nature of Data Structures
  • 9.1.2.
  • Indexing in Arrays
  • 9.1.3.
  • 1.5.3.
  • Array Operator
  • 9.1.4.
  • Storage in Runtime Memory
  • 9.2.
  • Defining Arrays
  • 9.3.
  • Writing Data to an Array
  • 9.4.
  • Defining and Initialising Arrays
  • 9.4.1.
  • Getting Started
  • Runtime Errors
  • Defining and Initialising Separately
  • 9.4.1.1.
  • Stand Alone Definition
  • 9.4.1.2.
  • Initialisation
  • 9.4.2.
  • Defining and Initialising on the same Line
  • 9.5.
  • Reading Data from an Array
  • 9.6.
  • 2.
  • Using Arrays
  • 9.7.
  • Arrays as Function Inputs
  • 9.8.
  • Issues with Arrays
  • 9.9.
  • Multidimensional Arrays
  • 9.10.
  • Dynamic Arrays
  • 10.
  • Data Types & Operators
  • Pointers
  • 10.1.
  • What is the Practice of Addressing?
  • 10.1.1.
  • Addressing Outside the Programming World
  • 10.1.2.
  • Addressing Inside the Programming World
  • 10.2.
  • What are Pointers?
  • 10.2.1.
  • 2.1.
  • L-Value vs R-Value
  • 10.2.2.
  • Importance of Pointers
  • 10.3.
  • Implementing Pointers in C & C++
  • 10.3.1.
  • Defining Pointers: The * Operator
  • 10.3.1.1.
  • Placing the Asterisk BEFORE the Space
  • 10.3.1.2.
  • Learning by Example
  • Placing the Asterisk AFTER the Space
  • 10.3.2.
  • Populating Pointers: The & Operator
  • 10.3.2.1.
  • Definition and Population in the same line
  • 10.3.3.
  • Decoding Pointers:
  • 2.1.1.
  • Performing Calculations
  • 2.1.2.
  • Interacting with the Console Window
  • 2.2.
  • 1.1.
  • Variables
  • 2.2.1.
  • Naming Variables
  • 2.2.1.1.
  • Rules
  • 2.2.1.2.
  • Guidelines
  • 2.2.2.
  • Initialising a Variable
  • 2.2.2.1.
  • Setting Up the Programming Environment
  • Using Assignment Equals =
  • 2.2.2.2.
  • Using Parentheses ()
  • 2.2.2.3.
  • Which is Preferable?
  • 2.2.3.
  • Ensuring Read Only Status Using Const
  • 2.3.
  • Primitive Data Types
  • 2.3.1.
  • 1.1.1.
  • Type Casting
  • 2.3.1.1.
  • Prospective Problems with certain types
  • 2.3.1.2.
  • Static Casting of Types
  • 2.3.1.3.
  • Solution with Type Casting
  • 2.3.1.4.
  • C Style Casts
  • 2.4.
  • Software IDE
  • Operators
  • 2.4.1.
  • Mathematical Operators
  • 2.4.1.1.
  • Arithmetic Operators
  • 2.4.1.2.
  • Assignment & Equality Operators
  • 2.4.1.2.1.
  • Assignment Operations using =
  • 2.4.1.2.2.
  • 1.2.
  • = Operator in Mathematics and Computer Science
  • 2.4.1.2.3.
  • Equality Operations using ==
  • 2.4.1.2.4.
  • Compound Assignment Operators
  • 2.4.1.2.5.
  • Assignment vs Compound Assignment Operators
  • 2.4.1.3.
  • Increment & Decrement Operators
  • 2.4.1.3.1.
  • Review: 2 Uses of the Asterisk Operator
  • 10.4.
  • NULL Pointer
  • 10.4.1.
  • What is the NULL Pointer?
  • 10.4.1.1.
  • Do not Confuse NULL Pointers and NUL Characters
  • 10.4.2.
  • Defining the NULL Pointer
  • 10.4.3.
  • The * Operator
  • Applications of the NULL Pointer
  • 10.5.
  • Void Pointer
  • 10.5.1.
  • Issues with the Void Pointer
  • 10.6.
  • Pointers as Function Inputs
  • 10.6.1.
  • Problems: Lack of Addressing
  • 10.6.2.
  • 10.3.4.
  • Passing Function Inputs as Pointers
  • 10.6.2.1.
  • Formal Parameters as Pointers
  • 10.6.2.2.
  • Actual Parameters as Pointers
  • 10.6.3.
  • Fixing the Problems Using Pointer Inputs
  • 10.6.4.
  • Importance of Pointer Inputs
  • 10.7.
  • Demonstration: Creating & Using Pointers
  • Pointer as the Function Output
  • 10.7.1.
  • Prospective Dangling Pointer Problem
  • 11.
  • Advanced Pointers
  • 11.1.
  • Pointer to Pointer Hierarchies
  • 11.1.1.
  • One Level: Pointer to a Pointer
  • 11.1.2.
  • 10.3.5.
  • Multiple Level Pointers
  • 11.2.
  • Read-Only Pointers Using Const
  • 11.3.
  • Pointers to Functions
  • 11.4.
  • Arrays of Pointers
  • 11.4.1.
  • Array of Pointers to Primitive Variables
  • 11.4.2.
  • Potential Problem: Type Mismatch
  • Array of Pointers to Functions
  • 12.
  • References
  • 12.1.
  • What are References?
  • 12.1.1.
  • L-Value vs R-Value
  • 12.1.2.
  • Restrictions with References
  • 12.2.
  • 10.3.6.
  • Implementing References in C++
  • 12.2.1.
  • Defining References --
  • Equating Pointers
  • 10.3.7.
  • References as Function Inputs
  • Definition as Array, Declaration as a Pointer from a Separate File
  • 16.3.2.
  • Output of a Function
  • 16.3.3.
  • Using the Assignment Operator
  • 16.3.4.
  • Using the Sizeof Operator
  • 16.3.5.
  • Using the Contents of "*" Operator
  • 16.4.
  • 12.4.1.
  • Arrays & References: Not Interchangeable
  • 16.5.
  • Summary: Interchangeability of Arrays and Pointers
  • 17.
  • Abstract Data Types
  • 17.1.
  • What is Abstraction?
  • 17.1.1.
  • Abstraction Outside the Programming World
  • 17.1.2.
  • Problems: Lack of Addressing
  • Problems: Lack of Abstraction
  • 17.1.3.
  • Introducing Abstraction
  • 17.2.
  • What are Abstract Data Types?
  • 17.3.
  • Structures
  • 17.3.1.
  • Defining Structures
  • 17.3.2.
  • 12.4.2.
  • Instantiating Structures
  • 17.3.3.
  • Accessing Member Data Using the DOT Operators
  • 17.3.4.
  • Using Structures
  • 17.3.5.
  • Possible Notation Using Typedef
  • 17.3.6.
  • Limitations of Structures
  • 17.4.
  • Passing Function Inputs as References
  • Unions
  • 17.5.
  • Enumerations/Enums
  • 17.5.1.
  • Declaring Enums
  • 17.5.2.
  • Using Enums
  • 17.5.2.1.
  • Popularity of Enum Use
  • 17.6.
  • 12.4.2.1.
  • Pointers to ADTS
  • 17.6.1.
  • Definition and Population
  • 17.6.2.
  • "Arrow" Operator
  • 17.6.2.1.
  • Preference Over the Dot Operator
  • 17.7.
  • References to ADTs
  • 17.7.1.
  • Formal Parameters as References
  • Definition and Population
  • 17.7.2.
  • Access Using the Dot Operator
  • 18.
  • C++ Classes & Objects
  • 18.1.
  • What is Encapsulation?
  • 18.1.1.
  • Encapsulation Outside the Programming World
  • 18.2.
  • 12.4.2.2.
  • Implementing Abstraction & Encapsulation in C++
  • 18.2.1.
  • Terminology - Native Class
  • 18.2.2.
  • Building on ADTs
  • 18.3.
  • Structure of a Class
  • 18.3.1.
  • Knowledge & Skill Analogy
  • 18.4.
  • Actual Parameters as References
  • Implementing a C++ Class - Method 1 of 2
  • 18.4.1.
  • Scope of a Variable (2)
  • 18.5.
  • Implementing Objects
  • 18.5.1.
  • Objects on the Runtime Stack
  • 18.5.1.1.
  • Creating Objects Directly
  • 18.5.1.1.1.
  • 12.4.3.
  • Dot Operator
  • 18.5.1.1.2.
  • Equating Objects
  • 18.5.2.
  • Arrays of Objects
  • 18.5.3.
  • Pointers to Objects
  • 18.5.3.1.
  • Definition and Population
  • 18.5.3.2.
  • Contents note continued:
  • Fixing the Problems Using References
  • "Arrow" Operator
  • 18.5.3.2.1.
  • Preference over the dot operator
  • 18.5.3.3.
  • Using Pointers to Objects
  • 18.5.4.
  • References to Objects
  • 18.5.4.1.
  • Definition and Population
  • 18.5.4.2.
  • 13.
  • Access Using the Dot Operator
  • 18.5.4.3.
  • Using References to Objects
  • 18.5.5.
  • Objects on the Runtime Heap
  • 18.5.5.1.
  • Definition and Population
  • 18.5.5.2.
  • Using Objects on the Runtime Heap
  • 18.5.5.3.
  • Advanced References
  • Java & C# - All Objects on the Heap
  • 18.5.6.
  • Objects as Function Inputs
  • 18.5.7.
  • Object as the Function Output
  • 18.6.
  • Implementing a C++ Class - Method 2 of 2
  • 18.6.1.
  • Scope Resolution Operator
  • 18.6.2.
  • 13.1.
  • Separating the Declaration & Definitions Lexically
  • 18.6.3.
  • Managing a Class Over Multiple Files
  • 18.7.
  • Defining a Class: Definition & Declarations, Together vs Separate
  • 18.8.
  • Special Class Members
  • 18.9.
  • Constructors
  • 18.9.1.
  • Read-Only References Using Const
  • What are Constructors?
  • 18.9.2.
  • Rules of Constructors
  • 18.9.3.
  • Using Constructors
  • 18.9.3.1.
  • Defining Constructors
  • 18.9.3.2.
  • Invoking Constructors
  • 18.9.4.
  • 13.2.
  • Overloading Constructors
  • 18.9.4.1.
  • Defining Overloaded Constructors
  • 18.9.4.2.
  • Invoking Overloaded Constructors
  • 18.9.5.
  • Default Constructor
  • 18.9.6.
  • Alternative Means of Initialising Data Members
  • 18.9.7.
  • Potential Ambiguities in Reference Notation
  • Further Initialisation Work in Constructors
  • 18.10.
  • Destructors
  • 18.10.1.
  • What are Destructors?
  • 18.10.2.
  • Rules of Destructors
  • 18.10.3.
  • Using Destructors
  • 18.10.4.
  • 13.3.
  • Default Destructor
  • 18.11.
  • Constructors and Destructors for Objects on the Runtime Heap
  • 19.
  • Object Oriented Design Using UML
  • 19.1.
  • What is UML?
  • 19.2.
  • Modelling in UML
  • 19.2.1.
  • Reference to a Function
  • UML Diagrams
  • 19.2.2.
  • Class Diagrams
  • 19.2.3.
  • Object Diagrams
  • 19.3.
  • Beauties of Object Oriented Programming
  • 20.
  • Abstraction & Encapsulation Using Classes & Objects (2)
  • 20.1.
  • 14.
  • Mutator Member Function
  • 20.1.1.
  • What are Mutators?
  • 20.1.1.1.
  • Mutators do not violate Encapsulation
  • 20.1.2.
  • Defining and Using Mutators
  • 20.2.
  • Const Member Functions
  • 20.2.1.
  • 12.2.2.
  • Runtime Memory Management
  • What is a Const Member Function?
  • 20.2.2.
  • Making a Member Function Const
  • 20.2.3.
  • Using Const Member Function
  • 20.3.
  • Static Data Members
  • 20.3.1.
  • What are Static Data Members?
  • 20.3.2.
  • 14.1.
  • Initialising Static Data Members
  • 20.3.3.
  • Using Static Data Members
  • 20.4.
  • Static Member Functions
  • 20.4.1.
  • What are Static Member Functions?
  • 20.4.1.1.
  • Rules of Static Member Functions?
  • 20.4.2.
  • Garbage Collection
  • Using the Static Member Functions
  • 20.5.
  • Assignment Operator
  • 20.5.1.
  • What is the Assignment Operator?
  • 20.5.2.
  • Using the Assignment Operator
  • 20.5.3.
  • Default Assignment Operator
  • 20.6.
  • 14.2.
  • Copy Constructor
  • 20.6.1.
  • What is the Copy Constructor?
  • 20.6.1.1.
  • Assignment vs. Initialisation
  • 20.6.1.2.
  • Essential Nature of the Copy Constructor
  • 20.6.1.3.
  • Rules of the Copy Constructor
  • 20.6.1.3.1.
  • Runtime Stack
  • Input of a Copy Constructor
  • 20.6.1.4.
  • Constructor vs
  • 14.2.1.
  • LIFO: Last in First Out Nature
  • 14.2.2.
  • Stack Overflow
  • 14.3.
  • Populating References
  • Runtime Heap/Free Store
  • 14.3.1.
  • New Operator
  • 14.3.2.
  • Delete Operator
  • 14.3.2.1.
  • Dangling Pointer
  • 14.4.
  • Using the Runtime Heap
  • 14.4.1.
  • 12.2.3.
  • Direct Usage from the Stack
  • 14.4.2.
  • Sharing the Runtime Heap Between Function Calls
  • 14.5.
  • Prospective Bugs When Using the Runtime Heap
  • 14.5.1.
  • Memory Leaks
  • 14.5.2.
  • Memory Corruption
  • 14.5.3.
  • Decoding References
  • Dangling Pointers
  • 14.5.3.1.
  • Smart Pointers
  • 14.6.
  • Malloc() and free() From C Programming
  • 14.7.
  • Using Both the Runtime Stack and Heap
  • 14.7.1.
  • When to Use Which Runtime Memory
  • 14.8.
  • 12.3.
  • Dynamic Arrays
  • 14.8.1.
  • New[] and Delete[] Operators
  • 15.
  • Pointers vs References
  • 15.1.
  • Contrast: Definitions and Usage
  • 15.2.
  • Rules of Thumb: When to Use Pointers & References
  • 16.
  • Using References
  • Pointers vs Arrays: Mostly Interchangeable, Sometimes Not
  • 16.1.
  • Nature of Pointers & Arrays
  • 16.1.1.
  • Placement in Runtime Memory
  • 16.1.2.
  • Array and Pointer Operators
  • 16.2.
  • Where Arrays and Pointers are Interchangeable
  • 16.2.1.
  • 12.4.
  • Mixing Pointer and Array Syntaxes in Definitions and Accessing
  • 16.2.1.1.
  • Define as Pointer, accessed as Array
  • 16.2.1.2.
  • Array of Pointers
  • 16.2.2.
  • Input to a Function
  • 16.3.
  • Where Arrays and Pointers are Not Interchangeable
  • 16.3.1.
  • What is the this Pointer?
  • UML Realisation
  • 22.5.3.
  • Public, Protected, Private Inheritance
  • 22.6.
  • Constructor & Destructor Calls in Inherited Classes
  • 22.7.
  • Single Implementation Inheritance
  • 22.8.
  • Single Interface Inheritance
  • 22.8.1.
  • 20.7.2.
  • Abstract Class
  • 22.8.2.
  • Using Interface Inheritance
  • 22.8.3.
  • Beauties of Interface Inheritance
  • 22.9.
  • Multiple Implementation Inheritance
  • 22.9.1.
  • Reasons for Multiple Implementation Inheritance
  • 22.9.2.
  • Using the this Pointer
  • Creating Multiple Implementation Inheritance
  • 22.9.3.
  • Prospective Evils of Multiple Implementation Inheritance
  • 22.9.3.1.
  • Ambiguity
  • 22.9.3.1.1.
  • Resolving Using the Scope Resolution Operator
  • 22.9.3.2.
  • Diamond Shaped Multiple Inheritance
  • 22.9.3.2.1.
  • 20.8.
  • Resolving Using Virtual Inheritance/Virtual Classes
  • 22.9.3.3.
  • Potential Lack of Organisation --
  • Address-of Operator
  • 20.9.
  • Inner Classes
  • 20.9.1.
  • Nested Classes
  • 20.9.1.1.
  • Copy Constructor
  • What are Nested Classes
  • 20.9.1.2.
  • Rules of Nested Classes
  • 20.9.1.3.
  • Creating and Using Nested Classes
  • 20.9.2.
  • Local Classes
  • 20.10.
  • Explicit Constructors
  • 20.10.1.
  • 20.6.2.
  • Implicit Conversions
  • 20.10.2.
  • Preventing Implicit Conversions Using Explicit Constructors
  • 20.11.
  • What a Class Creates Behind the Scenes
  • 20.12.
  • Friendship
  • 20.12.1.
  • Friend Functions
  • 20.12.2.
  • Implementing and Using the Copy Constructor
  • Friend Classes
  • 20.12.3.
  • Properties of Friendship
  • 20.12.4.
  • Prospective Evils of Friendship
  • 20.12.5.
  • Refined Definitions of Access Specifiers
  • 21.
  • Operator Overloading
  • 21.1.
  • 20.6.3.
  • What is Operator Overloading?
  • 21.1.1.
  • C++ Operators - Most but not all can be Overloaded
  • 21.1.1.1.
  • Prohibited Overloads
  • 21.1.2.
  • Implementing Operator Overloading
  • 21.2.
  • Overloading Unary Operators
  • 21.2.1.
  • Default Copy Constructor
  • Overloading the Increment Operators
  • 21.3.
  • Overloading Binary Operators
  • 21.4.
  • Overloading the Assignment Operator
  • 21.4.1.
  • Arguments for & Against Overloading =
  • 21.5.
  • Advanced Uses of Operator Overloading
  • 21.6.
  • 20.7.
  • Prospective Evils of Operator Overloading
  • 22.
  • Inheritance
  • 22.1.
  • What is Inheritance?
  • 22.1.1.
  • Terminology
  • 22.2.
  • Modelling Inheritance in UML
  • 22.2.1.
  • "This" Pointer
  • Inheritance Outside the Programming World
  • 22.2.2.
  • Inheritance Inside the Computer World
  • 22.3.
  • C++ Syntax: Inheritance
  • 22.3.1.
  • Single Inheritance
  • 22.3.2.
  • Multiple Inheritance
  • 22.4.
  • 20.7.1.
  • Access Specifier "Protected"
  • 22.4.1.
  • Prospective Evils of Protected
  • 22.5.
  • Categories of Inheritance
  • 22.5.1.
  • Single, Multiple Inheritance
  • 22.5.2.
  • Implementation, Interface
  • 22.5.2.1.
  • Full Definitions of Access Specifiers
  • CSV (Comma Separated Values) Files
  • 25.4.
  • Working With Binary Files
  • 25.4.1.
  • Saving & Retrieving Primitive Variables
  • 25.4.2.
  • Saving & Retrieving Objects
  • 25.4.2.1.
  • Working with Single Objects
  • 25.4.2.2.
  • 22.13.
  • Working with an Array of Objects
  • 25.5.
  • Further File Categories
  • 26.
  • What is Generic Programming?
  • 26.1.
  • Generic Thinking
  • 26.1.1.
  • Generic Thinking Outside the Programming World
  • 26.1.2.
  • Suggested Rules of Thumb
  • Generic Thinking Inside the Programming World
  • 26.1.2.1.
  • Problems: Lack of Generics
  • 27.
  • Function Templates
  • 27.1.
  • Creating Function Templates
  • 27.2.
  • Instantiating Function Templates
  • 27.2.1.
  • 23.
  • Compiler Generated Code
  • 27.2.1.1.
  • Compiler Intelligence
  • 27.3.
  • Polymorphism in Generic Programming
  • 28.
  • Class Templates
  • 28.1.
  • Creating Class TEMPLATES
  • 28.2.
  • Polymorphism
  • Using Class Templates
  • 28.3.
  • Template Parameters & Arguments
  • 28.3.1.
  • Non-Type Template Parameters
  • 28.3.2.
  • Template Template Parameters
  • 28.3.3.
  • Default Template Arguments
  • 28.4.
  • 23.1.
  • Class Template Design in UML
  • 28.5.
  • Beauties of Generic Programming
  • 29.
  • Template Specialisation & Overloading
  • 29.1.
  • What is Template Specialisation
  • 29.2.
  • Function Template Specialisation
  • 29.2.1.
  • What is Polymorphism?
  • Implementing Function Template Specialisation
  • 29.3.
  • Class Template Specialisation
  • 29.3.1.
  • Explicit Specialisation
  • 29.3.2.
  • Partial Specialisation
  • 30.
  • Duplicate Keywords
  • 30.1.
  • 23.1.1.
  • Keyword "STATIC"
  • 30.2.
  • Keyword "VIRTUAL"
  • 30.3.
  • Keyword "CLASS"
  • 31.
  • Duplicate Symbols/Operators
  • 31.1.
  • Asterisk *
  • 31.2.
  • Polymorphism Outside the Programming World
  • Ampersand &
  • 31.3.
  • Meanings of the = Symbol
  • 31.4.
  • Parentheses Operator 0
  • 31.5.
  • Scope Resolution Operator ::
  • 32.
  • Using Const
  • 32.1.
  • 23.2.
  • Const Pointers
  • 33.
  • Casting
  • Appendix A: C++ Primitive Data Types
  • Appendix B: C++ Operators
  • Appendix C: Reserved Keywords In C++
  • Contents note continued:
  • Implementing Polymorphism in C++
  • 23.2.1.
  • Requirements
  • 23.2.2.
  • OOP Inheritance Hierarchy
  • 23.2.3.
  • Virtual Member Functions
  • 23.2.4.
  • Pointers in Inheritance Hierarchies
  • 23.2.5.
  • 22.9.3.4.
  • Polymorphism on the Runtime Stack
  • 23.2.6.
  • Runtime Binding
  • 23.2.7.
  • Polymorphism on the Runtime Heap
  • 23.3.
  • Pure Virtual Member Functions
  • 23.3.1.
  • Interface Inheritance
  • 23.3.2.
  • Multiple Inheritance in other OOP Languages
  • Notation
  • 23.3.3.
  • Class Forced to be Abstract
  • 23.3.4.
  • Using Pure Virtual Functions
  • 23.4.
  • Beauties of Polymorphism
  • 23.4.1.
  • Essential Nature of Polymorphism
  • 23.4.2.
  • 22.10.
  • Pointers Preferred Over References
  • 23.5.
  • Data Structures of Polymorphic Objects
  • 23.6.
  • Dynamic Casting
  • 23.7.
  • Further Polymorphism
  • 24.
  • Exception Handling
  • 24.1.
  • Multiple Interface Inheritance
  • What is Exception Handling?
  • 24.1.1.
  • When to Use Exception Handling
  • 24.1.2.
  • Exception Handling in C++
  • 24.2.
  • Anatomy of an Exception Handler
  • 24.3.
  • Exception: Division by Zero
  • 24.4.
  • 22.11.
  • Exception: User Input of Inappropriate Type
  • 24.5.
  • Exception: Out of Bounds Array
  • 24.6.
  • Special Exceptions
  • 24.7.
  • Warning: Never Get A Destructor to Throw an Exception
  • 24.8.
  • Catching Multiple Exceptions
  • 25.
  • Private & Protected Inheritance
  • Files & Streams
  • 25.1.
  • C++ I/O Stream Classes
  • 25.2.
  • Giving Inputs to the Main Function
  • 25.3.
  • Working with Text Files
  • 25.3.1.
  • Reading From a Text File
  • 25.3.2.
  • 22.12.
  • Writing to a Text File
  • 25.3.2.1.
  • Overwriting Existing Data
  • 25.3.2.2.
  • Appending a Text File
  • 25.3.3.
  • Converting From String Characters
  • 25.3.4.
  • Further Text Files
  • 25.3.4.1.
Control code
MSTDDA5493972
Dimensions
unknown
Extent
1 online resource ( 666 p..):
Form of item
online
Isbn
9788793609440
Reproduction note
Electronic reproduction.
Specific material designation
remote
Label
Cybernetics in C++, (electronic resource)
Publication
Note
  • Description based upon print version of record
  • 4. PROGRAMMING PRACTICE
Contents
  • Hello World
  • Post Increment
  • 2.4.1.3.2.
  • Pre Increment
  • 2.4.1.3.3.
  • Similarities & Differences: Pre Increment & Post Increment
  • 2.4.1.4.
  • Bitwise Operators
  • 2.4.2.
  • Logical Operators
  • 2.4.3.
  • 1.3.
  • Sizeof Operator
  • 3.
  • Control Statements
  • 3.1.
  • Conditional Statements
  • 3.1.1.
  • If Statements
  • 3.1.1.1.
  • What is a condition?
  • 3.1.2.
  • Writing C++ Source Code
  • if, Then, Else Clause
  • 3.1.2.1.
  • Alternative Form using the Ternary? : Operator
  • 3.1.3.
  • Cascaded/Nested if Statements
  • 3.1.4.
  • if, Else if, Else Clause
  • 3.1.5.
  • Switch Statement
  • 3.1.6.
  • 1.3.1.
  • Switch Statement vs if, Else if, Else Clause
  • 3.2.
  • Problem Solving with Loops
  • 3.2.1.
  • What are Loops?
  • 3.2.2.
  • For Loop
  • 3.2.3.
  • While Loop
  • 3.2.3.1.
  • Comments
  • Empty While Loop
  • 3.2.4.
  • Do Loop/While Loop
  • 3.3.
  • C++ Statements & Constructs
  • 3.3.1.
  • Blocks
  • 3.3.2.
  • Break Statement
  • 3.3.3.
  • 1.3.1.1.
  • Continue Statement
  • 3.3.4.
  • Goto Statement
  • 3.3.4.1.
  • Prospective Evils of the goto statement
  • 3.3.5.
  • Dropping the Braces 0 For 1 Action
  • 3.3.5.1.
  • Potential Hazards in dropping the Braces
  • 3.3.5.1.1.
  • Style with Primitive Tools
  • Breaking at the Wrong Place
  • 3.3.5.1.2.
  • Dangling Else Clause Issue
  • 3.3.5.2.
  • Guideline with Braces
  • 3.4.
  • Creating Aliases IN C & C++
  • 3.4.1.
  • Defining Constants Using #Define - Avoid in C++
  • 3.4.1.1.
  • 1.3.2.
  • Issues with Macro Aliases
  • 3.4.2.
  • Typedef
  • 3.4.2.1.
  • Cannot modify Typedef
  • 4.
  • Programming Practice
  • 4.1.
  • Good vs Bad Practices
  • 4.2.
  • Source Code Files
  • Guidelines
  • 4.2.1.
  • Organisation
  • 4.2.2.
  • Naming of Variables
  • 4.2.3.
  • Formatting of Source Code
  • 4.3.
  • Debugging
  • 4.3.1.
  • 1.4.
  • Breakpoints
  • 4.3.2.
  • Viewing Variables
  • 4.3.3.
  • Single Stepping
  • 5.
  • Functions
  • 5.1.
  • Procedural Thinking
  • 5.1.1.
  • Machine generated contents note:
  • Subsequent Stages in Building a Program
  • Procedural Thinking Outside the Programming World
  • 5.1.2.
  • Procedural Thinking Inside the Programming World
  • 5.2.
  • What are Functions?
  • 5.2.1.
  • Function Naming
  • 5.2.2.
  • Function Definitions
  • 5.2.3.
  • 1.4.1.
  • Function Declarations
  • 5.2.3.1.
  • Signature of a Function (1)
  • 5.2.4.
  • Function Invocation
  • 5.2.4.1.
  • Caution: Circular Reference
  • 5.2.5.
  • Declarations vs Definitions
  • 5.3.
  • Compilation
  • Functions: No Inputs, No Output
  • 5.4.
  • Functions: Some Inputs, No Output
  • 5.4.1.
  • Signature of a Function (2)
  • 5.4.2.
  • Formal Parameters vs. Actual Parameters
  • 5.4.3.
  • Passing a Copy of the Value
  • 5.4.4.
  • 1.4.1.1.
  • No Predetermined Order of Evaluation of Actual Parameters
  • 5.4.5.
  • Modifying Formal Parameters
  • 5.4.5.1.
  • Default Values
  • 5.4.5.2.
  • Const Formal Parameters
  • 5.5.
  • Functions: Some Inputs, an output
  • 5.5.1.
  • Object Files
  • Returning a Value
  • 5.6.
  • Main Function
  • 5.7.
  • Scope of a Variable
  • 5.7.1.
  • Global Variables
  • 5.7.1.1.
  • Prospective Evils of Global Variables
  • 5.7.2.
  • 1.4.2.
  • Local Variables
  • 5.7.2.1.
  • Automatic Local Variables
  • 5.7.2.2.
  • Static Local Variables
  • 5.7.2.2.1.
  • Initialising Static Local Variables
  • 5.7.2.2.2.
  • Caution with Static Local Variables
  • 5.8.
  • Linking
  • Debugging: Single Step In
  • 5.8.1.
  • Debug/Call Stack
  • 5.9.
  • Overloading Functions
  • 5.9.1.
  • Prospective Evils of Function Overloading
  • 6.
  • Inline Functions and Macros
  • 6.1.
  • 1.4.3.
  • Function Invocation Overhead
  • 6.2.
  • C Macros - For the Best Part Avoid in C++
  • 6.2.1.
  • Creating a Macro
  • 6.2.2.
  • Conditional Preprocessor Directives
  • 6.2.2.1.
  • #ifdef, #ifndef #endif Clause
  • 6.2.3.
  • Running
  • Prospective Evils of Macros
  • 6.2.3.1.
  • Losing Track of Types
  • 6.2.3.2.
  • Losing Track of the Name
  • 6.2.3.3.
  • Operator Precedence Problems
  • 6.2.4.
  • Rules of Thumb with Macros
  • 6.3.
  • 1.5.
  • Inline Functions
  • 6.3.1.
  • Defining & Declaring Inline Functions
  • 6.3.2.
  • Using Inline Functions
  • 6.3.3.
  • Inline Keyword: A Request, Not an Instruction
  • 6.3.4.
  • Macro Problems not Manifest in Inline Functions
  • 7.
  • 1.
  • Debugging (1)
  • Program Management Over Multiple Files
  • 7.1.
  • Software Projects
  • 7.1.1.
  • Source Code
  • 7.2.
  • Building C++ Projects
  • 7.2.1.
  • Compilation
  • 7.2.2.
  • 1.5.1.
  • Linking
  • 7.3.
  • Controlling Visibility
  • 7.3.1.
  • Creating External Visibility Using Extern
  • 7.3.1.1.
  • Linker Error caused by a Lack of Definition
  • 7.3.2.
  • Hiding External Visibility Using Static
  • 7.3.2.1.
  • What are Bugs/Errors?
  • Duplication of the keyword static
  • 7.4.
  • Namespaces
  • 7.5.
  • Potential Problem: Multiple Inclusions
  • 7.6.
  • Preventing Multiple Inclusions
  • 7.6.1.
  • Ensuring Single Inclusions Using Macros
  • 7.6.1.1.
  • 1.5.2.
  • Using #ifndef to prevent Multiple Inclusions
  • 7.6.2.
  • Ensuring Single Inclusions Using Preprocessor Directives
  • 8.
  • Recursion
  • 8.1.
  • What is Recursion?
  • 8.1.1.
  • Recursion Outside the Programming World
  • 8.1.2.
  • Compile-Time Errors
  • Recursion Inside the Programming World
  • 8.2.
  • Caution with Recursion
  • 8.3.
  • Computing Factorials
  • 8.3.1.
  • Iterative Algorthm: Using Loops
  • 8.3.2.
  • Using Recursion
  • 8.4.
  • 1.5.2.1.
  • Fibonacci Sequence
  • 8.4.1.
  • Applications of the Fibonacci Sequence
  • 8.5.
  • Generating Permutations
  • 8.5.1.
  • Recursive
  • 8.5.2.
  • Next Permutation Algorithm
  • 8.6.
  • Compiler Errors
  • Hanoi Towers
  • 8.6.1.
  • Strategy for 3 Rings
  • 8.6.2.
  • Strategy for 4 Rings
  • 8.6.3.
  • Iterative Strategies
  • 8.6.4.
  • Recursive Strategies
  • 8.6.5.
  • 1.5.2.2.
  • Implementing Recursion in Hanoi Towers
  • 8.6.6.
  • Traditional Legends of Hanoi Towers
  • 8.7.
  • Further Recursive Problems
  • 8.7.1.
  • Triangular Numbers
  • 8.7.2.
  • Knapsack/Rucksack Problem
  • 8.7.3.
  • Compiler Warning
  • N Queens Problem
  • 9.
  • Arrays
  • 9.1.
  • What are Arrays?
  • 9.1.1.
  • Homogeneous Nature of Data Structures
  • 9.1.2.
  • Indexing in Arrays
  • 9.1.3.
  • 1.5.3.
  • Array Operator
  • 9.1.4.
  • Storage in Runtime Memory
  • 9.2.
  • Defining Arrays
  • 9.3.
  • Writing Data to an Array
  • 9.4.
  • Defining and Initialising Arrays
  • 9.4.1.
  • Getting Started
  • Runtime Errors
  • Defining and Initialising Separately
  • 9.4.1.1.
  • Stand Alone Definition
  • 9.4.1.2.
  • Initialisation
  • 9.4.2.
  • Defining and Initialising on the same Line
  • 9.5.
  • Reading Data from an Array
  • 9.6.
  • 2.
  • Using Arrays
  • 9.7.
  • Arrays as Function Inputs
  • 9.8.
  • Issues with Arrays
  • 9.9.
  • Multidimensional Arrays
  • 9.10.
  • Dynamic Arrays
  • 10.
  • Data Types & Operators
  • Pointers
  • 10.1.
  • What is the Practice of Addressing?
  • 10.1.1.
  • Addressing Outside the Programming World
  • 10.1.2.
  • Addressing Inside the Programming World
  • 10.2.
  • What are Pointers?
  • 10.2.1.
  • 2.1.
  • L-Value vs R-Value
  • 10.2.2.
  • Importance of Pointers
  • 10.3.
  • Implementing Pointers in C & C++
  • 10.3.1.
  • Defining Pointers: The * Operator
  • 10.3.1.1.
  • Placing the Asterisk BEFORE the Space
  • 10.3.1.2.
  • Learning by Example
  • Placing the Asterisk AFTER the Space
  • 10.3.2.
  • Populating Pointers: The & Operator
  • 10.3.2.1.
  • Definition and Population in the same line
  • 10.3.3.
  • Decoding Pointers:
  • 2.1.1.
  • Performing Calculations
  • 2.1.2.
  • Interacting with the Console Window
  • 2.2.
  • 1.1.
  • Variables
  • 2.2.1.
  • Naming Variables
  • 2.2.1.1.
  • Rules
  • 2.2.1.2.
  • Guidelines
  • 2.2.2.
  • Initialising a Variable
  • 2.2.2.1.
  • Setting Up the Programming Environment
  • Using Assignment Equals =
  • 2.2.2.2.
  • Using Parentheses ()
  • 2.2.2.3.
  • Which is Preferable?
  • 2.2.3.
  • Ensuring Read Only Status Using Const
  • 2.3.
  • Primitive Data Types
  • 2.3.1.
  • 1.1.1.
  • Type Casting
  • 2.3.1.1.
  • Prospective Problems with certain types
  • 2.3.1.2.
  • Static Casting of Types
  • 2.3.1.3.
  • Solution with Type Casting
  • 2.3.1.4.
  • C Style Casts
  • 2.4.
  • Software IDE
  • Operators
  • 2.4.1.
  • Mathematical Operators
  • 2.4.1.1.
  • Arithmetic Operators
  • 2.4.1.2.
  • Assignment & Equality Operators
  • 2.4.1.2.1.
  • Assignment Operations using =
  • 2.4.1.2.2.
  • 1.2.
  • = Operator in Mathematics and Computer Science
  • 2.4.1.2.3.
  • Equality Operations using ==
  • 2.4.1.2.4.
  • Compound Assignment Operators
  • 2.4.1.2.5.
  • Assignment vs Compound Assignment Operators
  • 2.4.1.3.
  • Increment & Decrement Operators
  • 2.4.1.3.1.
  • Review: 2 Uses of the Asterisk Operator
  • 10.4.
  • NULL Pointer
  • 10.4.1.
  • What is the NULL Pointer?
  • 10.4.1.1.
  • Do not Confuse NULL Pointers and NUL Characters
  • 10.4.2.
  • Defining the NULL Pointer
  • 10.4.3.
  • The * Operator
  • Applications of the NULL Pointer
  • 10.5.
  • Void Pointer
  • 10.5.1.
  • Issues with the Void Pointer
  • 10.6.
  • Pointers as Function Inputs
  • 10.6.1.
  • Problems: Lack of Addressing
  • 10.6.2.
  • 10.3.4.
  • Passing Function Inputs as Pointers
  • 10.6.2.1.
  • Formal Parameters as Pointers
  • 10.6.2.2.
  • Actual Parameters as Pointers
  • 10.6.3.
  • Fixing the Problems Using Pointer Inputs
  • 10.6.4.
  • Importance of Pointer Inputs
  • 10.7.
  • Demonstration: Creating & Using Pointers
  • Pointer as the Function Output
  • 10.7.1.
  • Prospective Dangling Pointer Problem
  • 11.
  • Advanced Pointers
  • 11.1.
  • Pointer to Pointer Hierarchies
  • 11.1.1.
  • One Level: Pointer to a Pointer
  • 11.1.2.
  • 10.3.5.
  • Multiple Level Pointers
  • 11.2.
  • Read-Only Pointers Using Const
  • 11.3.
  • Pointers to Functions
  • 11.4.
  • Arrays of Pointers
  • 11.4.1.
  • Array of Pointers to Primitive Variables
  • 11.4.2.
  • Potential Problem: Type Mismatch
  • Array of Pointers to Functions
  • 12.
  • References
  • 12.1.
  • What are References?
  • 12.1.1.
  • L-Value vs R-Value
  • 12.1.2.
  • Restrictions with References
  • 12.2.
  • 10.3.6.
  • Implementing References in C++
  • 12.2.1.
  • Defining References --
  • Equating Pointers
  • 10.3.7.
  • References as Function Inputs
  • Definition as Array, Declaration as a Pointer from a Separate File
  • 16.3.2.
  • Output of a Function
  • 16.3.3.
  • Using the Assignment Operator
  • 16.3.4.
  • Using the Sizeof Operator
  • 16.3.5.
  • Using the Contents of "*" Operator
  • 16.4.
  • 12.4.1.
  • Arrays & References: Not Interchangeable
  • 16.5.
  • Summary: Interchangeability of Arrays and Pointers
  • 17.
  • Abstract Data Types
  • 17.1.
  • What is Abstraction?
  • 17.1.1.
  • Abstraction Outside the Programming World
  • 17.1.2.
  • Problems: Lack of Addressing
  • Problems: Lack of Abstraction
  • 17.1.3.
  • Introducing Abstraction
  • 17.2.
  • What are Abstract Data Types?
  • 17.3.
  • Structures
  • 17.3.1.
  • Defining Structures
  • 17.3.2.
  • 12.4.2.
  • Instantiating Structures
  • 17.3.3.
  • Accessing Member Data Using the DOT Operators
  • 17.3.4.
  • Using Structures
  • 17.3.5.
  • Possible Notation Using Typedef
  • 17.3.6.
  • Limitations of Structures
  • 17.4.
  • Passing Function Inputs as References
  • Unions
  • 17.5.
  • Enumerations/Enums
  • 17.5.1.
  • Declaring Enums
  • 17.5.2.
  • Using Enums
  • 17.5.2.1.
  • Popularity of Enum Use
  • 17.6.
  • 12.4.2.1.
  • Pointers to ADTS
  • 17.6.1.
  • Definition and Population
  • 17.6.2.
  • "Arrow" Operator
  • 17.6.2.1.
  • Preference Over the Dot Operator
  • 17.7.
  • References to ADTs
  • 17.7.1.
  • Formal Parameters as References
  • Definition and Population
  • 17.7.2.
  • Access Using the Dot Operator
  • 18.
  • C++ Classes & Objects
  • 18.1.
  • What is Encapsulation?
  • 18.1.1.
  • Encapsulation Outside the Programming World
  • 18.2.
  • 12.4.2.2.
  • Implementing Abstraction & Encapsulation in C++
  • 18.2.1.
  • Terminology - Native Class
  • 18.2.2.
  • Building on ADTs
  • 18.3.
  • Structure of a Class
  • 18.3.1.
  • Knowledge & Skill Analogy
  • 18.4.
  • Actual Parameters as References
  • Implementing a C++ Class - Method 1 of 2
  • 18.4.1.
  • Scope of a Variable (2)
  • 18.5.
  • Implementing Objects
  • 18.5.1.
  • Objects on the Runtime Stack
  • 18.5.1.1.
  • Creating Objects Directly
  • 18.5.1.1.1.
  • 12.4.3.
  • Dot Operator
  • 18.5.1.1.2.
  • Equating Objects
  • 18.5.2.
  • Arrays of Objects
  • 18.5.3.
  • Pointers to Objects
  • 18.5.3.1.
  • Definition and Population
  • 18.5.3.2.
  • Contents note continued:
  • Fixing the Problems Using References
  • "Arrow" Operator
  • 18.5.3.2.1.
  • Preference over the dot operator
  • 18.5.3.3.
  • Using Pointers to Objects
  • 18.5.4.
  • References to Objects
  • 18.5.4.1.
  • Definition and Population
  • 18.5.4.2.
  • 13.
  • Access Using the Dot Operator
  • 18.5.4.3.
  • Using References to Objects
  • 18.5.5.
  • Objects on the Runtime Heap
  • 18.5.5.1.
  • Definition and Population
  • 18.5.5.2.
  • Using Objects on the Runtime Heap
  • 18.5.5.3.
  • Advanced References
  • Java & C# - All Objects on the Heap
  • 18.5.6.
  • Objects as Function Inputs
  • 18.5.7.
  • Object as the Function Output
  • 18.6.
  • Implementing a C++ Class - Method 2 of 2
  • 18.6.1.
  • Scope Resolution Operator
  • 18.6.2.
  • 13.1.
  • Separating the Declaration & Definitions Lexically
  • 18.6.3.
  • Managing a Class Over Multiple Files
  • 18.7.
  • Defining a Class: Definition & Declarations, Together vs Separate
  • 18.8.
  • Special Class Members
  • 18.9.
  • Constructors
  • 18.9.1.
  • Read-Only References Using Const
  • What are Constructors?
  • 18.9.2.
  • Rules of Constructors
  • 18.9.3.
  • Using Constructors
  • 18.9.3.1.
  • Defining Constructors
  • 18.9.3.2.
  • Invoking Constructors
  • 18.9.4.
  • 13.2.
  • Overloading Constructors
  • 18.9.4.1.
  • Defining Overloaded Constructors
  • 18.9.4.2.
  • Invoking Overloaded Constructors
  • 18.9.5.
  • Default Constructor
  • 18.9.6.
  • Alternative Means of Initialising Data Members
  • 18.9.7.
  • Potential Ambiguities in Reference Notation
  • Further Initialisation Work in Constructors
  • 18.10.
  • Destructors
  • 18.10.1.
  • What are Destructors?
  • 18.10.2.
  • Rules of Destructors
  • 18.10.3.
  • Using Destructors
  • 18.10.4.
  • 13.3.
  • Default Destructor
  • 18.11.
  • Constructors and Destructors for Objects on the Runtime Heap
  • 19.
  • Object Oriented Design Using UML
  • 19.1.
  • What is UML?
  • 19.2.
  • Modelling in UML
  • 19.2.1.
  • Reference to a Function
  • UML Diagrams
  • 19.2.2.
  • Class Diagrams
  • 19.2.3.
  • Object Diagrams
  • 19.3.
  • Beauties of Object Oriented Programming
  • 20.
  • Abstraction & Encapsulation Using Classes & Objects (2)
  • 20.1.
  • 14.
  • Mutator Member Function
  • 20.1.1.
  • What are Mutators?
  • 20.1.1.1.
  • Mutators do not violate Encapsulation
  • 20.1.2.
  • Defining and Using Mutators
  • 20.2.
  • Const Member Functions
  • 20.2.1.
  • 12.2.2.
  • Runtime Memory Management
  • What is a Const Member Function?
  • 20.2.2.
  • Making a Member Function Const
  • 20.2.3.
  • Using Const Member Function
  • 20.3.
  • Static Data Members
  • 20.3.1.
  • What are Static Data Members?
  • 20.3.2.
  • 14.1.
  • Initialising Static Data Members
  • 20.3.3.
  • Using Static Data Members
  • 20.4.
  • Static Member Functions
  • 20.4.1.
  • What are Static Member Functions?
  • 20.4.1.1.
  • Rules of Static Member Functions?
  • 20.4.2.
  • Garbage Collection
  • Using the Static Member Functions
  • 20.5.
  • Assignment Operator
  • 20.5.1.
  • What is the Assignment Operator?
  • 20.5.2.
  • Using the Assignment Operator
  • 20.5.3.
  • Default Assignment Operator
  • 20.6.
  • 14.2.
  • Copy Constructor
  • 20.6.1.
  • What is the Copy Constructor?
  • 20.6.1.1.
  • Assignment vs. Initialisation
  • 20.6.1.2.
  • Essential Nature of the Copy Constructor
  • 20.6.1.3.
  • Rules of the Copy Constructor
  • 20.6.1.3.1.
  • Runtime Stack
  • Input of a Copy Constructor
  • 20.6.1.4.
  • Constructor vs
  • 14.2.1.
  • LIFO: Last in First Out Nature
  • 14.2.2.
  • Stack Overflow
  • 14.3.
  • Populating References
  • Runtime Heap/Free Store
  • 14.3.1.
  • New Operator
  • 14.3.2.
  • Delete Operator
  • 14.3.2.1.
  • Dangling Pointer
  • 14.4.
  • Using the Runtime Heap
  • 14.4.1.
  • 12.2.3.
  • Direct Usage from the Stack
  • 14.4.2.
  • Sharing the Runtime Heap Between Function Calls
  • 14.5.
  • Prospective Bugs When Using the Runtime Heap
  • 14.5.1.
  • Memory Leaks
  • 14.5.2.
  • Memory Corruption
  • 14.5.3.
  • Decoding References
  • Dangling Pointers
  • 14.5.3.1.
  • Smart Pointers
  • 14.6.
  • Malloc() and free() From C Programming
  • 14.7.
  • Using Both the Runtime Stack and Heap
  • 14.7.1.
  • When to Use Which Runtime Memory
  • 14.8.
  • 12.3.
  • Dynamic Arrays
  • 14.8.1.
  • New[] and Delete[] Operators
  • 15.
  • Pointers vs References
  • 15.1.
  • Contrast: Definitions and Usage
  • 15.2.
  • Rules of Thumb: When to Use Pointers & References
  • 16.
  • Using References
  • Pointers vs Arrays: Mostly Interchangeable, Sometimes Not
  • 16.1.
  • Nature of Pointers & Arrays
  • 16.1.1.
  • Placement in Runtime Memory
  • 16.1.2.
  • Array and Pointer Operators
  • 16.2.
  • Where Arrays and Pointers are Interchangeable
  • 16.2.1.
  • 12.4.
  • Mixing Pointer and Array Syntaxes in Definitions and Accessing
  • 16.2.1.1.
  • Define as Pointer, accessed as Array
  • 16.2.1.2.
  • Array of Pointers
  • 16.2.2.
  • Input to a Function
  • 16.3.
  • Where Arrays and Pointers are Not Interchangeable
  • 16.3.1.
  • What is the this Pointer?
  • UML Realisation
  • 22.5.3.
  • Public, Protected, Private Inheritance
  • 22.6.
  • Constructor & Destructor Calls in Inherited Classes
  • 22.7.
  • Single Implementation Inheritance
  • 22.8.
  • Single Interface Inheritance
  • 22.8.1.
  • 20.7.2.
  • Abstract Class
  • 22.8.2.
  • Using Interface Inheritance
  • 22.8.3.
  • Beauties of Interface Inheritance
  • 22.9.
  • Multiple Implementation Inheritance
  • 22.9.1.
  • Reasons for Multiple Implementation Inheritance
  • 22.9.2.
  • Using the this Pointer
  • Creating Multiple Implementation Inheritance
  • 22.9.3.
  • Prospective Evils of Multiple Implementation Inheritance
  • 22.9.3.1.
  • Ambiguity
  • 22.9.3.1.1.
  • Resolving Using the Scope Resolution Operator
  • 22.9.3.2.
  • Diamond Shaped Multiple Inheritance
  • 22.9.3.2.1.
  • 20.8.
  • Resolving Using Virtual Inheritance/Virtual Classes
  • 22.9.3.3.
  • Potential Lack of Organisation --
  • Address-of Operator
  • 20.9.
  • Inner Classes
  • 20.9.1.
  • Nested Classes
  • 20.9.1.1.
  • Copy Constructor
  • What are Nested Classes
  • 20.9.1.2.
  • Rules of Nested Classes
  • 20.9.1.3.
  • Creating and Using Nested Classes
  • 20.9.2.
  • Local Classes
  • 20.10.
  • Explicit Constructors
  • 20.10.1.
  • 20.6.2.
  • Implicit Conversions
  • 20.10.2.
  • Preventing Implicit Conversions Using Explicit Constructors
  • 20.11.
  • What a Class Creates Behind the Scenes
  • 20.12.
  • Friendship
  • 20.12.1.
  • Friend Functions
  • 20.12.2.
  • Implementing and Using the Copy Constructor
  • Friend Classes
  • 20.12.3.
  • Properties of Friendship
  • 20.12.4.
  • Prospective Evils of Friendship
  • 20.12.5.
  • Refined Definitions of Access Specifiers
  • 21.
  • Operator Overloading
  • 21.1.
  • 20.6.3.
  • What is Operator Overloading?
  • 21.1.1.
  • C++ Operators - Most but not all can be Overloaded
  • 21.1.1.1.
  • Prohibited Overloads
  • 21.1.2.
  • Implementing Operator Overloading
  • 21.2.
  • Overloading Unary Operators
  • 21.2.1.
  • Default Copy Constructor
  • Overloading the Increment Operators
  • 21.3.
  • Overloading Binary Operators
  • 21.4.
  • Overloading the Assignment Operator
  • 21.4.1.
  • Arguments for & Against Overloading =
  • 21.5.
  • Advanced Uses of Operator Overloading
  • 21.6.
  • 20.7.
  • Prospective Evils of Operator Overloading
  • 22.
  • Inheritance
  • 22.1.
  • What is Inheritance?
  • 22.1.1.
  • Terminology
  • 22.2.
  • Modelling Inheritance in UML
  • 22.2.1.
  • "This" Pointer
  • Inheritance Outside the Programming World
  • 22.2.2.
  • Inheritance Inside the Computer World
  • 22.3.
  • C++ Syntax: Inheritance
  • 22.3.1.
  • Single Inheritance
  • 22.3.2.
  • Multiple Inheritance
  • 22.4.
  • 20.7.1.
  • Access Specifier "Protected"
  • 22.4.1.
  • Prospective Evils of Protected
  • 22.5.
  • Categories of Inheritance
  • 22.5.1.
  • Single, Multiple Inheritance
  • 22.5.2.
  • Implementation, Interface
  • 22.5.2.1.
  • Full Definitions of Access Specifiers
  • CSV (Comma Separated Values) Files
  • 25.4.
  • Working With Binary Files
  • 25.4.1.
  • Saving & Retrieving Primitive Variables
  • 25.4.2.
  • Saving & Retrieving Objects
  • 25.4.2.1.
  • Working with Single Objects
  • 25.4.2.2.
  • 22.13.
  • Working with an Array of Objects
  • 25.5.
  • Further File Categories
  • 26.
  • What is Generic Programming?
  • 26.1.
  • Generic Thinking
  • 26.1.1.
  • Generic Thinking Outside the Programming World
  • 26.1.2.
  • Suggested Rules of Thumb
  • Generic Thinking Inside the Programming World
  • 26.1.2.1.
  • Problems: Lack of Generics
  • 27.
  • Function Templates
  • 27.1.
  • Creating Function Templates
  • 27.2.
  • Instantiating Function Templates
  • 27.2.1.
  • 23.
  • Compiler Generated Code
  • 27.2.1.1.
  • Compiler Intelligence
  • 27.3.
  • Polymorphism in Generic Programming
  • 28.
  • Class Templates
  • 28.1.
  • Creating Class TEMPLATES
  • 28.2.
  • Polymorphism
  • Using Class Templates
  • 28.3.
  • Template Parameters & Arguments
  • 28.3.1.
  • Non-Type Template Parameters
  • 28.3.2.
  • Template Template Parameters
  • 28.3.3.
  • Default Template Arguments
  • 28.4.
  • 23.1.
  • Class Template Design in UML
  • 28.5.
  • Beauties of Generic Programming
  • 29.
  • Template Specialisation & Overloading
  • 29.1.
  • What is Template Specialisation
  • 29.2.
  • Function Template Specialisation
  • 29.2.1.
  • What is Polymorphism?
  • Implementing Function Template Specialisation
  • 29.3.
  • Class Template Specialisation
  • 29.3.1.
  • Explicit Specialisation
  • 29.3.2.
  • Partial Specialisation
  • 30.
  • Duplicate Keywords
  • 30.1.
  • 23.1.1.
  • Keyword "STATIC"
  • 30.2.
  • Keyword "VIRTUAL"
  • 30.3.
  • Keyword "CLASS"
  • 31.
  • Duplicate Symbols/Operators
  • 31.1.
  • Asterisk *
  • 31.2.
  • Polymorphism Outside the Programming World
  • Ampersand &
  • 31.3.
  • Meanings of the = Symbol
  • 31.4.
  • Parentheses Operator 0
  • 31.5.
  • Scope Resolution Operator ::
  • 32.
  • Using Const
  • 32.1.
  • 23.2.
  • Const Pointers
  • 33.
  • Casting
  • Appendix A: C++ Primitive Data Types
  • Appendix B: C++ Operators
  • Appendix C: Reserved Keywords In C++
  • Contents note continued:
  • Implementing Polymorphism in C++
  • 23.2.1.
  • Requirements
  • 23.2.2.
  • OOP Inheritance Hierarchy
  • 23.2.3.
  • Virtual Member Functions
  • 23.2.4.
  • Pointers in Inheritance Hierarchies
  • 23.2.5.
  • 22.9.3.4.
  • Polymorphism on the Runtime Stack
  • 23.2.6.
  • Runtime Binding
  • 23.2.7.
  • Polymorphism on the Runtime Heap
  • 23.3.
  • Pure Virtual Member Functions
  • 23.3.1.
  • Interface Inheritance
  • 23.3.2.
  • Multiple Inheritance in other OOP Languages
  • Notation
  • 23.3.3.
  • Class Forced to be Abstract
  • 23.3.4.
  • Using Pure Virtual Functions
  • 23.4.
  • Beauties of Polymorphism
  • 23.4.1.
  • Essential Nature of Polymorphism
  • 23.4.2.
  • 22.10.
  • Pointers Preferred Over References
  • 23.5.
  • Data Structures of Polymorphic Objects
  • 23.6.
  • Dynamic Casting
  • 23.7.
  • Further Polymorphism
  • 24.
  • Exception Handling
  • 24.1.
  • Multiple Interface Inheritance
  • What is Exception Handling?
  • 24.1.1.
  • When to Use Exception Handling
  • 24.1.2.
  • Exception Handling in C++
  • 24.2.
  • Anatomy of an Exception Handler
  • 24.3.
  • Exception: Division by Zero
  • 24.4.
  • 22.11.
  • Exception: User Input of Inappropriate Type
  • 24.5.
  • Exception: Out of Bounds Array
  • 24.6.
  • Special Exceptions
  • 24.7.
  • Warning: Never Get A Destructor to Throw an Exception
  • 24.8.
  • Catching Multiple Exceptions
  • 25.
  • Private & Protected Inheritance
  • Files & Streams
  • 25.1.
  • C++ I/O Stream Classes
  • 25.2.
  • Giving Inputs to the Main Function
  • 25.3.
  • Working with Text Files
  • 25.3.1.
  • Reading From a Text File
  • 25.3.2.
  • 22.12.
  • Writing to a Text File
  • 25.3.2.1.
  • Overwriting Existing Data
  • 25.3.2.2.
  • Appending a Text File
  • 25.3.3.
  • Converting From String Characters
  • 25.3.4.
  • Further Text Files
  • 25.3.4.1.
Control code
MSTDDA5493972
Dimensions
unknown
Extent
1 online resource ( 666 p..):
Form of item
online
Isbn
9788793609440
Reproduction note
Electronic reproduction.
Specific material designation
remote

Library Locations

    • Curtis Laws Wilson LibraryBorrow it
      400 West 14th Street, Rolla, MO, 65409, US
      37.955220 -91.772210
Processing Feedback ...