C++ Development – Course Outline

(4 days – RAT210)

 

C++ brings the benefits of object-oriented development to the much-used C programming language. This course leaves students with both an understanding of object-oriented principles and a practical knowledge of how to implement them in C++.

 

Attendees

Software developers and team leaders who need a professional level of understanding of the C++ programming language.

 

Features

At the end of this course, you’ll be able to:

·         Develop quality code using the object-oriented development paradigm

·         Create extensible type libraries using inheritance and polymorphism

·         Improve reliability by encapsulating attributes and functionality

·         Use the symbolic operators with arbitrary, complex types

·         Implement robust and reliable error handling in an application

·         Customise an application’s memory allocation strategy

·         Perform safer type conversions

·         Develop generic, re-usable type and function libraries using templates

·        Use all C++ features to the full

 

Agenda:

 

Introduction
  • Introduces C++, explores its C lineage, and covers basic features of the language.
  • The bool keyword
  • Static members, function overloading and inlining
  • Namespaces
  • References
Member Functions

Introduces the concept of binding code to data and explores the C++ support for this core concept.

 

  • Member function syntax, the ‘this’ pointer
  • Inline member functions
  • Constructors and destructors
  • Copy constructors
  • Unwanted/unexpected constructor/destructor calls
  • The explicit keyword
New and Delete

Explores the shortcomings of malloc and then proceeds to the C++ dynamic allocation mechanism.

  • New and delete
  • When new fails, deleting non-existent objects
Inheritance

Explores the reasoning behind another major C++ feature and the mechanism by which it is implemented.

·         Inheritance theory, derivation syntax

·         Member functions and derived classes

·         Multiple inheritance

·         Multiple virtual inheritance

·         Inheritance misuse, abuse and limitations

Access and State Control

Covers the principles and practise of encapsulation by the restriction of visibility and mutability.

  • The private, public and protected keyword
  • Access specifiers and inheritance
  • Friends
  • The const keyword
  • Const member functions and references
  • The mutable keyword

 

 

Virtual Functions

Examines the theory behind polymorphism and how this powerful concept is realised in C++.

  • Virtual function syntax
  • The virtual function mechanism
  • Pure virtual functions
  • Interaction of virtual functions with other features
Operator Overloading

Covers the support in C++ for ‘syntactic transparency’ through the use of operator functions.

  • Operator overloading syntax
  • Post and pre-fix operators
  • Overloading new, delete, ‘->’ and “=”
  • Conversion operators
  • Interaction of operator overloading with other features
Run Time Type Information

Examines the dynamic acquisition of object identity.

  • The typeid operator, the type_info class
  • Misuse of RTTI
Exception Handling

Explores the problems with traditional error handling techniques before covering the C++ alternative.

·         Try, throw and catch

·         Trapping different exceptions, exception specifications

·         Ignoring and re-throwing exceptions

·         Exception handling and constructors/destructors

Casting

Covers explicit type conversion in C++ and its use.

·         Problems with old-style casting

·         C++ casting syntax

Templates

Explores the support C++ provides for parameterised function and type generation.

  • Template functions and classes
  • Nested templates, templates as template parameters
  • Value parameters
  • Templates and inheritance