Instructor-led training
C++ Programming Training in Depew, New York
Develop the ability to design and write programs in the C++ language, emphasizing object-oriented approaches to designing solutions.
What you'll learn
Private Training for Teams
This course is offered as private, instructor-led training for organizations, onsite in Depew, New York or live online. Dates, delivery format, and course content are arranged around your team's requirements.
This course is not currently scheduled as a public class for individual enrollment.
Request Group TrainingPrerequisites
Course Outline
Classes
Creating a Data Structure
Methods
Object Scope
C++ Input and Output
Namespaces
Data Abstraction
Enforcing Data Encapsulation
File Organization
Classes in C++
Objects
this Pointer
Constructors and Destructors
Debug Output
The Default Constructor
When are Constructors Called?
The Destructor
The Copy Constructor
Other Constructors
Why did it work before?
Composition
The Report Class
Code Reuse
Initialization Lists
Inheritance
Inheritance
Bugreport
Protected Access Modifier
Access and Inheritance
Constructors and Inheritance
Initialization Lists Revisited
Multiple Inheritance
Virtual Functions
Inheritance and Assignment
Inside Report's Assignment Operator
Using Pointers - a Quick Look at Basics
Class Assignment and Pointers
Static Binding
Dynamic Binding
Polymorphism
The show_rep() Function
Using the show_rep() Function
Designing member Function Inheritance
Pure Virtual Functions
Bugfix and its Relationship with Bugreport
Bugfix: Association with Bugreport
Using Bugfix with show_rep()
Adding Bugfix to the Hierarchy
Coding for the Document Class
Reexamining the Document Class
Pure Virtual Functions
Designing Member Function Inheritance
References & Constants
References
Displaying References
Changing References
Pass by Reference
Returning by Reference
Constant Variables
Constant References
Constant Methods
new and delete
new and delete
Array Allocation
The Report Class
Compiler Version of the Copy Constructor
Guidelines for Copy Constructors
The Report Constructors and new
The Report Destructor and delete
Virtual Destructors
Casting in C++
Casting: a Review
New Casting Syntax
Creating a String Class
The String Class
The Conversion Constructor
Expanding Our Casting Options
Casting Operator
Using the Casting Operator
Class Methods and Data
Class Data
Class Methods
Using the New Data
More on Class Methods
Overloaded Functions
Function Overloading
Using Overloaded Functions
Rules for Overloading
Overloading Based on Constness
Default Arguments
Invoking Functions with Default Arguments
Overloaded Operators
The Basics of Overloading
Overloading operator+
Coping with Commutativity
Non-Commutative Operators
friends and Their Problems
The Assignment Operator
Overloading the << Operator
Using Date with cout
Exception Handling
Why Exception Handling?
try / catch / throw
Exception Classes
Standard Exception Hierarchy
Multiple catch Blocks
Catching Everything
Unhandled Exceptions
Exception in Constructors and Destructors
Designing for Exceptions
Standard Template Library
Class Template Concepts
Standard Template Library (STL) Overview
Containers
Iterators
Iterator Syntax
Non-Mutating Sequential Algorithms
Mutating Sequential Algorithms
Sorting Algorithms
Numeric Algorithms
auto_ptr Class
string Class
STL Containers
Container Classes
Container Class Algorithms
vector Class
Additional vector Class Methods
deque Class
list Class
set and multiset Classes
map and multimap Classes
Appendix A: Reference Sheets
Constants, References, and Pointers
Input/Output
this Pointer
The Complete Report/Document Hierarchy
Appendix B: Templates
Scenario
Designing an Array Class
Code for FloatArray
Code for IntArray
Templates
Templates Syntax
Using Templates
Using Classes with Templates
Additional Template Features
Standard Template Library
Appendix C: Sample Problems
Banking System
Library Card Catalog
Diagrams for Banking and Library Problems
Appendix D: Other C++ Features
Namespaces
The static_cast and reinterpret_cast operator
The dynamic_cast operator
The const_cast operator
mutable Data Members
The bool Datatype
new Operator Failure
What makes this material hard to master
The syntax is manageable for a C programmer. The difficulty is object lifetime: who creates an object, who copies it, and who destroys it. The syllabus builds toward that in a deliberate order.
- Classes and object lifecycle. It starts with classes,
this, namespaces and encapsulation, then constructors and destructors. Debug output shows when each one runs, and the default and copy constructors get their own treatment. - Reuse. Composition and initialization lists come first, then inheritance, access modifiers, constructor order and multiple inheritance.
- Polymorphism. Static versus dynamic binding, virtual and pure virtual functions, and what happens to inheritance and assignment. A common misconception is that a base-class pointer automatically calls the derived behavior. It does so only when the function is virtual.
- References, const and memory. Pass and return by reference, constant references and methods, then
new/delete, array allocation and virtual destructors. The topic Why did it work before? points at a classic trap. A compiler-generated copy constructor copies pointers, not what they point to, so it works until the class owns memory. - Language features. A String class with a conversion constructor, casting syntax and casting operators, then function and operator overloading including
operator+, friends and<<. Exception handling follows, including exceptions in constructors and destructors. - Library. STL containers, iterators, algorithms and the
stringclass come last.
Each block assumes the previous one. Operator overloading and exception design are hard to follow if copy semantics and destructors are still shaky.
Who it suits and what to take around it
The course is general level, runs five days, and lists C Programming as its prerequisite. It suits C developers moving to object-oriented design, and teams that maintain class-based C++ code and want a shared grounding in classes, inheritance, overloading, exceptions and the STL.
Developers without C experience will probably be better served by C++ Programming for Non-C Programmers, which is designed for that starting point.
Afterward, Modern C++ Programming using C++11/C++14 is a natural step for newer language features. Advanced C++ Programming suits developers who want to go deeper into design. Organizations working with a particular compiler or language release can ask for private training tailored to the versions they use through a training proposal.
Illustrative scenarios
The scenarios below are illustrations of how the course material can be applied. They are not descriptions of specific organizations or of the course's lab exercises.
- Report generation. A team might model several report types as one hierarchy with a pure virtual base class. Callers hold base pointers and rely on dynamic binding and virtual destructors. This ties to inheritance, virtual functions, polymorphism and pure virtual functions.
- A custom string or array type. A team might need a class that owns heap memory and must be copied safely. That calls for
new/delete, a correct copy constructor and assignment operator, a conversion constructor and overloaded operators. The same design can be reused for several element types through templates. - Input processing with error handling. A team might read records, store them in a
vectorormap, sort and search them with STL algorithms, and report failures through a custom exception class derived from the standard hierarchy. This ties to exception classes, multiplecatchblocks, containers, iterators and algorithms.
AI coding assistants and this material
AI coding assistants are useful for explaining unfamiliar class hierarchies, decoding long compiler diagnostics (template errors especially), drafting unit tests, and sketching boilerplate such as constructors and operator<<.
They fail where this course concentrates:
- Ownership. Generated classes often omit a copy constructor or assignment operator for a class that owns memory, or leak on an early exit.
- Polymorphism. A base class may be missing a virtual destructor, or an override may silently hide the base function instead of overriding it.
- Exceptions. Code may throw from a destructor, or leave an object half-constructed when a constructor throws.
- STL. Iterators may be used after a
vectororlistchanges. Suggestions may also mix idioms from different eras of the language.
To verify, compile with warnings enabled and treat them as errors. Run tests under sanitizers (ASan, UBSan) and use static analysis. Add constructor and destructor trace output, as the syllabus's debug output topic does, to confirm that objects are created, copied and destroyed as expected.
Frequently asked questions
What level is this course and what should I know first?
It is a general-level, five-day course. The listed prerequisite is C Programming, so you should be comfortable with C syntax, functions and pointers before starting.
What does the course cover?
Classes, constructors and destructors, composition, inheritance, virtual functions and polymorphism, references and const, dynamic memory, casting, function and operator overloading, exception handling, and the Standard Template Library. Appendices cover templates, sample problems and additional language features.
Is this taught in person or online?
HSG delivers private training for organizations, either onsite at the client's location or live online.
Can the content be customized?
Yes. Private courses can be tailored to your team's needs and to the technology versions your organization uses, including current releases. You can start with a training proposal request.
I do not have a C background. Is there another option?
C++ Programming for Non-C Programmers is designed for developers starting without C experience.
Training locations
C++ Programming training across the U.S. and beyond.
We provide private C++ Programming training for organizations, onsite at your location or live online, throughout the United States and internationally.
View all C++ Programming training locations
Train your team with HSG
Private, instructor-led training customized for your organization.
- Onsite or live online delivery
- Customized curriculum
- For a single employee or an entire team
- Flexible scheduling
- Experienced instructors
Questions? Call us at 303.377.6176
or email info@hartmannsoftware.com
Ready to train your team?
Let's customize this training for your organization.
Tell us about your employees, your goals, and your preferred schedule. We'll prepare a training proposal covering scope, delivery format, and pricing.