Title Cybernetics in C++
Subtitle (River Publishers Series in Software Engineering)
Author Avi Bhattacharyya
ISBN 9788793609457
List price USD 125.00
Price outside India Available on Request
Original price
Binding Hardbound
No of pages 500
Book size 152 X 235 mm
Publishing year 2018
Original publisher River Publishers (Eurospan Group)
Published in India by .
Exclusive distributors Viva Books Private Limited
Sales territory India, Sri Lanka, Bangladesh, Pakistan, Nepal, .
Status New Arrival
About the book Send Enquiry
  
 

Description:

C++ is a powerful, much sought after programming language, but can be daunting to work with, even for engineering professionals.

Why is this book so useful? Have you ever wondered:

  • How do keywords like static and virtual change their meanings according to context?
  • What are the similarities and differences between Pointers and References, Pointers and Arrays, Constructors and Copy Constructors, Nested and Local Inner Classes?
  • Why is Multiple Interface Inheritance seen to be beautiful but Multiple Implementation Inheritance considered evil?
  • When is Polymorphism Static or Dynamic, Bounded or Unbounded?

Answers on these questions, and much more, are explained in this book, Cybernetics in C++. What makes this text so different and appealing in comparison to existing books on the market?

  • The Bulleted style, as opposed to Prose, produces results much faster, both in learning and reference
  • Rules of Thumb, and further expert Tips are given throughout in how to optimise your code
  • The Prospective Evils sections tell you what to avoid
  • The thorough coverage ensures you will be trained to expert level in each of Imperative, Procedural, Memory & Resource Management, Object Oriented and Generic Programming

Cybernetics in C++ combines a theoretical overview and practical approach in one book, which should prove to be a useful reference for computer scientists, software programmers, engineers and students in this and related field.


Contents:

Preface

Dedication

List of Figures

List of Programs

Introduction

Part I: Imperative Programming (1)

Chapter 1: Getting Started • Setting Up the Programming Environment • Software IDE • Hello World • Writing C++ Source Code • Comments • Style with Primitive Tools • Source Code Files • Subsequent Stages in Building a Program • Compilation • Object Files • Linking • Running • Debugging (1) • What are Bugs/Errors? • Compile-Time Errors • Compiler Errors • Compiler Warning • Runtime Errors

Chapter 2: Data Types & Operators • Learning by Example • Performing Calculations • Interacting with the Console Window • Variables • Naming Variables • Rules • Guidelines • Initialising a Variable • Using Assignment Equals = • Using Parentheses () • Which is Preferable? • Ensuring Read Only Status Using Const • Primitive Data Types • Type Casting • Prospective Problems with certain types • Static Casting of Types • Solution with Type Casting • C Style Casts • Operators • Mathematical Operators • Arithmetic Operators • Assignment & Equality Operators • Assignment Operations using = • = Operator in Mathematics and Computer Science • Equality Operations using == • Compound Assignment Operators • Assignment vs Compound Assignment Operators • Increment & Decrement Operators • Post Increment • Pre Increment • Similarities & Differences: Pre Increment & Post Increment • Bitwise Operators • Logical Operators • The Sizeof Operator

Chapter 3: Control Statements • Conditional Statements • If Statements • What is a condition? • The if, Then, Else Clause • Alternative Form using the Ternaty?: Operator • Cascaded/Nested if Statements • The if, Else if, Else Clause • Switch Statement • Switch Statement vs if, Else if, Else Clause • Problem Solving with Loops • What are Loops? • For Loop • While Loop • Empty While Loop • Do Loop/While Loop • C++ Statements & Constructs • Blocks • Break Statement • Continue Statement • The Goto Statement • Prospective Evils of the goto statement • Dropping the Braces {} For 1 Action • Potential Hazards in dropping the Braces • Breaking at the Wrong Place • Dangling Else Clause Issue • Guideline with Braces • Creating Aliases IN C & C++ • Defining Constants Using #Define - Avoid in C++ • Issues with Macro Aliases • Typedef • Cannot modify Typedef

Chapter 4: Programming Practice • Good vs Bad Practices • Guidelines • Organisation • Naming of Variables • Formatting of Source Code • Debugging • Breakpoints • Viewing Variables • Single Stepping

Part II: Procedural Programming

Chapter 5: Functions • Procedural Thinking • Procedural Thinking Outside the Programming World • Procedural Thinking Inside the Programming World • What are Functions? • Function Naming • Function Definitions • Function Declarations • Signature of a Function (1) • Function Invocation • Caution: Circular Reference • Declarations vs Definitions • Functions: No Inputs, No Output • Functions: Some Inputs, No Output • Signature of a Function (2) • Formal Parameters vs Actual Parameters • Passing a Copy of the Value • No Predetermined Order of Evaluation of Actual Parameters • Modifying Formal Parameters • Default Values • Const Formal Parameters • Functions: Some Inputs, an output • Returning a Value • The Main Function • Scope of a Variable • Global Variables • Prospective Evils of Global Variables • Local Variables • Automatic Local Variables • Static Local Variables • Initialising Static Local Variables • Caution with Static Local Variables • Debugging: Single Step In • The Debug/Call Stack • Overloading Functions • Prospective Evils of Function Overloading

Chapter 6: Inline Functions and Macros • Function Invocation Overhead • C Macros - For the Best Part Avoid in C++ • Creating a Macro • Conditional Preprocessor Directives • The #ifdef, #ifndef #endif Clause • Prospective Evils of Macros • Losing Track of Types • Losing Track of the Name • Operator Precedence Problems • Rules of Thumb with Macros • Inline Functions • Defining & Declaring Inline Functions • Using Inline Functions • The Inline Keyword: A Request, Not an Instruction • Macro Problems not Manifest in Inline Functions

Chapter 7: Program Management Over Multiple Files • Software Projects • Source Code • Building C++ Projects • Compilation • Linking • Controlling Visibility • Creating External Visibility Using Extern • Linker Error caused by a Lack of Definition • Hiding External Visibility Using Static • Duplication of the keyword static • Namespaces • Potential Problem: Multiple Inclusions • Preventing Multiple Inclusions • Ensuring Single Inclusions Using Macros • Using #ifndef to prevent Multiple Inclusions • Ensuring Single Inclusions Using Preprocessor Directives

Chapter 8: Recursion • What is Recursion? • Recursion Outside the Programming World • Recursion Inside the Programming World • Caution with Recursion • Computing Factorials • Iterative Algorithm: Using Loops • Using Recursion • Fibonacci Sequence • Applications of the Fibonacci Sequence • Generating Permutations • Recursive • The Next Permutation Algorithm • Hanoi Towers • Strategy for 3 Rings • Strategy for 4 Rings • Iterative Strategies • Recursive Strategies • Implementing Recursion in Hanoi Towers • Traditional Legends of Hanoi Towers • Further Recursive Problems • Triangular Numbers • Knapsack/Rucksack Problem • N Queens Problem

Part III: Data Structures & Algorithms

Chapter 9: Arrays • What are Arrays? • Homogeneous Nature of Data Structures • Indexing in Arrays • The Array Operator • Storage in Runtime Memory • Defining Arrays • Writing Data to an Array • Defining and lnitialising Arrays • Defining and Initialising Separately • Stand Alone Definition • Initialisation • Defining and Initialising on the same Line • Reading Data from an Array • Using Arrays • Arrays as Function Inputs • Issues with Arrays • Multidimensional Arrays • Dynamic Arrays

Part IV: Memory & Resource Management Programming

Chapter 10: Pointers • What is the Practice of Addressing? • Addressing Outside the Programming World • Addressing Inside the Programming World • What are Pointers? • L-Value vs R-Value • The Importance of Pointers • Implementing Pointers in C & C++ • Defining Pointers: The * Operator • Placing the Asterisk BEFORE the Space • Placing the Asterisk AFTER the Space • Populating Pointers: The & Operator • Definition and Population in the same line • Decoding Pointers: The * Operator • Demonstration: Creating & Using Pointers • Potential Problem: Type Mismatch • Equating Pointers • Review: 2 Uses of the Asterisk Operator • The NULL Pointer • What is the NULL Pointer? • Do not Confuse NULL Pointers and NUL Characters • Defining the NULL Pointer • Applications of the NULL Pointer • The Void Pointer • Issues with the Void Pointer • Pointers as Function Inputs • Problems: Lack of Addressing • Passing Function Inputs as Pointers • Formal Parameters as Pointers • Actual Parameters as Pointers • Fixing the Problems Using Pointer Inputs • The Importance of Pointer Inputs • The Pointer as the Function Output • Prospective Dangling Pointer Problem

Chapter 11: Advanced Pointers • Pointer to Pointer Hierarchies • One Level: Pointer to a Pointer • Multiple Level Pointers • Read-only Pointers Using Const • Pointers to Functions • Arrays of Pointers • Array of Pointers to Primitive Variables • Array of Pointers to Functions

Chapter 12: References • What are References? L-Value vs R-Value • Restrictions with References • Implementing References in C++ • Defining References • Populating References • Decoding References • Using References • References as Function Inputs • Problems: Lack of Addressing • Passing Function Inputs as References • Formal Parameters as References • Actual Parameters as References • Fixing the Problems Using References

Chapter 13: Advanced References • Read-only References Using Const • Potential Ambiguities in Reference NotationReference to a Function

Chapter 14: Runtime Memory Management • Garbage Collection • The Runtime Stack • LIFO: Last in First Out Nature • Stack Overflow • The Runtime Heap/Free Store • The New Operator • The Delete Operator • Dangling Pointer • Using the Runtime Heap • Direct Usage from the Stack • Sharing the Runtime Heap Between Function Calls • Prospective Bugs When Using the Runtime Heap • Memory Leaks • Memory Corruption • Dangling Pointers • Smart Pointers • Malloc() and free() From C Programming • Using Both the Runtime Stack and Heap • When to Use Which Runtime Memory • Dynamic Arrays • The New[] and Delete[] Operators.

Chapter 15: Pointers vs References • Contrast: Definitions and Usage • Rules of Thumb: When to Use Pointers & References

Chapter 16: Pointers vs Arrays: Mostly Interchangeable, Sometimes Not • The Nature of Pointers & Arrays • Placement in Runtime Memory • Array and Pointer Operators • Where Arrays and Pointers are Interchangeable • Mixing Pointer and Array Syntaxes in Definitions and Accessing • Define as Pointer, accessed as Array • Array of Pointers • Input to a Function • Where Arrays and Pointers are Not Interchangeable • Definition as Array, Declaration as a Pointer from a Separate File • Output of a Function • Using the Assignment Operator • Using the Size of Operator • Using the Contents of “*” Operator • Arrays & References: Not Interchangeable • Summary: Interchangeability of Arrays and Pointers

Part V: Object Oriented Programming

Chapter 17: Abstract Data Types • What is Abstraction? • Abstraction Outside the Programming World • Problems: Lack of Abstraction • Introducing Abstraction • What are Abstract Data Types? • Structures • Defining Structures • Instantiating Structures • Accessing Member Data Using the DOT Operators • Using Structures • Possible Notation Using Typedef • Limitations of Structures • Unions • Enumerations/Enums • Declaring Enums • Using Enums • Popularity of Enum Use • Pointers to ADTS • Definition and Population • The “Arrow” Operator • Preference Over the Dot Operator • References to ADTs • Definition and Population • Access Using the Dot Operator

Chapter 18: C++ Classes & Objects • What is Encapsulation? • Encapsulation Outside the Programming World • Implementing Abstraction & Encapsulation in C++ • Terminology - Native Class • Building on ADTs • Structure of a Class • Knowledge & Skill Analogy • Implementing a C++ Class Method 1 of 2 • Scope of a Variable (2) • Implementing Objects • Objects on the Runtime Stack • Creating Objects Directly • The Dot Operator • Equating Objects • Arrays of Objects • Pointers to Objects • Definition and Population • The “Arrow” Operator • Preference over the dot operator • Using Pointers to Objects • References to Objects • Definition and Population • Access Using the Dot Operator • Using References to Objects • Objects on the Runtime Heap • Definition and Population • Using Objects on the Runtime Heap • Java & C# - All Objects on the Heap • Objects as Function Inputs • Object as the Function Output • Implementing a C++ Class - Method 2 of 2 • The Scope Resolution Operator • Separating the Declaration & Definitions Lexically • Managing a Class Over Multiple Files • Defining a Class: Definition & Declarations, Together vs Separate • Special Class Members • Constructors • What are Constructors? • Rules of Constructors • Using Constructors • Defining Constructors • Invoking Constructors • Overloading Constructors • Defining Overloaded Constructors • Invoking Overloaded Constructors • Default Constructor • Alternative Means of Initialising Data Members • Further Initialisation Work in Constructors • Destructors • What are Destructors? • Rules of Destructors • Using Destructors • Default Destructor • Constructors and Destructors for Objects on the Runtime Heap

Chapter 19: Object Oriented Design Using UML • What is UML? Modelling in UML • UML Diagrams • Class Diagrams • Object Diagrams • Beauties of Object Oriented Programming

Chapter 20: Abstraction & Encapsulation Using Classes & Objects (2) • Mutator Member FunctionWhat are Mutators? • Mutators do not violate Encapsulation • Defining and Using Mutators • Const Member Functions • What is a Const Member Function? • Making a Member Function Const • Using Const Member Function • Static Data Members • What are Static Data Members? • Initialising Static Data Members • Using Static Data Members • Static Member Functions • What are Static Member Functions? • Rules of Static Member Functions? • Using the Static Member Functions • Assignment Operator • What is the Assignment Operator? • Using the Assignment Operator • Default Assignment Operator • Copy Constructor • What is the Copy Constructor? • Assignment vs Initialisation • Essential Nature of the Copy Constructor • Rules of the Copy Constructor • Input of a Copy Constructor • Constructor vs. Copy Constructor • Implementing and Using the Copy Constructor • Default Copy Constructor • The “This” Pointer • What is the this Pointer? • Using the this Pointer • Address-of Operator • Inner Classes • Nested Classes • What are Nested Classes • Rules of Nested Classes • Creating and Using Nested Classes • Local Classes • Explicit Constructors • Implicit Conversions • Preventing Implicit Conversions Using Explicit Constructors • What a Class Creates Behind the Scenes • Friendship • Friend Functions • Friend Classes • Properties of Friendship • Prospective Evils of Friendship • Refined Definitions of Access Specifiers

Chapter 21: Operator Overloading • What is Operator Overloading? • C++ Operators - Most but not all can be Overloaded • Prohibited Overloads Implementing Operator Overloading • Overloading Unary Operators • Overloading the Increment Operators • Overloading Binary Operators • Overloading the Assignment Operator • Arguments for & Against Overloading = • Advanced Uses of Operator Overloading • Prospective Evils of Operator Overloading

Chapter 22: Inheritance • What is Inheritance? • Terminology • Modelling Inheritance in UML • Inheritance Outside the Programming World • Inheritance Inside the Computer World • C++ Syntax: Inheritance • Single Inheritance • Multiple Inheritance • The Access Specifier “Protected” • Prospective Evils of Protected • Categories of Inheritance • Single, Multiple Inheritance • Implementation, Interface • UML Realisation • Public Protected Private Inheritance • Constructor & Destructor Calls in Inherited Classes • Single Implementation Inheritance • Single Interface Inheritance • Abstract Class • Using Interface Inheritance • Beauties of Interface Inheritance • Multiple Implementation Inheritance • Reasons for Multiple Implementation Inheritance • Creating Multiple Implementation Inheritance • Prospective Evils of Multiple Implementation Inheritance • Ambiguity • Resolving Using the Scope Resolution Operator • Diamond Shaped Multiple Inheritance • Resolving Using Virtual Inheritance/Virtual Classes • Potential Lack of Organisation • Multiple Inheritance in other OOP Languages • Multiple Interface Inheritance • Private & Protected Inheritance • Full Definitions of Access Specifiers • Suggested Rules of Thumb

Chapter 23: Polymorphism • What is Polymorphism? • Polymorphism Outside the Programming World • Implementing Polymorphism in C++ • Requirements • OOP Inheritance Hierarchy • Virtual Member Functions • Pointers in Inheritance Hierarchies • Polymorphism on the Runtime Stack • Runtime Binding • Polymorphism on the Runtime Heap • Pure Virtual Member Functions • Interface Inheritance • Notation • Class Forced to be Abstract • Using Pure Virtual Functions • Beauties of Polymorphism • The Essential Nature of Polymorphism • Pointers Preferred Over References • Data Structures of Polymorphic Objects • Dynamic Casting • Further Polymorphism

Part VI: Imperative Programming (2)

Imperative Programming (2)

Chapter 24: Exception Handling • What is Exception Handling? • When to Use Exception Handling • Exception Handling in C++ • Anatomy of an Exception Handler • Exception: Division by Zero • Exception: User Input of Inappropriate Type • Exception: Out of Bounds Array • Special Exceptions • Warning: Never Get A Destructor to Throw an Exception • Catching Multiple Exceptions

Chapter 25: Files & Streams • The C++ I/O Stream Classes • Giving Inputs to the Main Function • Working with Text Files • Reading From a Text File • Writing to a Text File • Overwriting Existing Data • Appending a Text File • Converting From String Characters • Further Text Files • CSV (Comma Separated Values) Files • Working With Binary Files • Saving & Retrieving Primitive Variables • Saving & Retrieving Objects • Working with Single Objects • Working with an Array of Objects • Further File Categories

Part VII: Generic Programming

Chapter 26: What is Generic Programming? • Generic Thinking • Generic Thinking Outside the Programming World • Generic Thinking Inside the Programming World • Problems: Lack of Generics

Chapter 27: Function Templates • Creating Function Templates • Instantiating Function Templates • Compiler Generated Code • Compiler Intelligence • Polymorphism in Generic Programming

Chapter 28: Class Templates • Creating Class TEMPLATES • Using Class Templates • Template Parameters & Arguments • Non-Type Template Parameters • Template Template Parameters • Default Template Arguments • Class Template Design in UML • Beauties of Generic Programming

Chapter 29: Template Specialisation & Overloading • What is Template Specialisation • Function Template SpecialisationImplementing Function Template Specialisation • Class Template Specialisation • Explicit Specialisation • Partial Specialisation

Part VIII: Getting IT Together: Programming In C++

Chapter 30: Duplicate Keywords • The Keyword “STATIC” • The Keyword “VIRTUAL” • The Keyword “CLASS”

Chapter 31: Duplicate Symbols/Operators • The Asterisk * • The Ampersand & • The Meanings of the = Symbol • The Parentheses Operator () • The Scope Resolution Operator::

Chapter 32: Using Const • Const Pointers

Chapter 33: Casting

Summary & Conclusions

Appendix • Appendix A: C++ Primitive Data Types • Appendix B: C++ Operators • Appendix C: Reserved Keywords in C++

Bibliography

Index

About The Author


About the Author:

Avi Bhattacharyya, Shomiron Institute, UK.


Target Audience:

This book is a useful reference for computer scientists, software programmers, engineers and students in this and related field.

 
Special prices are applicable to the authorised sales territory only.
Prices are subject to change without prior notice.