Skip to main content

Instructor-led training

C++ Programming for Non-C Programmers Training in Lenoir, North Carolina

This course is a comprehensive hands-on introduction to object oriented programming in C++ for non-C programmers.

What you'll learn

This course is a comprehensive hands-on introduction to object oriented programming in C++ for non-C programmers. Emphasis is placed on the features of C++ that support effective modeling of the problem domain and reuse of code. The course consists of two modules. The first module introduces the core C features of C++, with simplified input/output through iostreams. The module begins with simple hands-on programming using C++ to do input, computation and output. The C++ data types are covered, and simple if tests and loops are covered. C++ program structure is introduced. Pointers, addressing, and arrays are discussed. Structures and unions are covered. In the second module, object-oriented concepts are introduced. The C++ class construct is introduced and its key features elaborated step-by-step, providing full implementation of abstract data types. C++ memory management is discussed. Function and operator overloading and the use of references are covered. The scope and access control mechanisms of C++ are described. Inheritance is introduced. The use of virtual functions to implement polymorphism is discussed. Extensive programming examples and exercises are provided. The course is current to ANSI standard C++ and is designed so that it can be taught in any environment with an ANSI C++ compiler.

Private Training for Teams

This course is offered as private, instructor-led training for organizations, onsite in Lenoir, North Carolina 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 Training

Prerequisites

Knowledge of a programming language.

Course Outline

First C++ Programs
Hello, World
Compiling and Running
C++ Program Components
Another C++ Program (Preview)
I/O in C++
Variables
Expressions
Assignment
Using C++ as a Calculator
Input in C++
Echo Program

Data Types and Operators
Data Types
Strong Typing
Typing in C++
Conversions in C++
Typing in Visual Basic
Primitive C++ Data Types
Signed and Unsigned
Twos Complement
C++ Integer Type Ranges
IntegerRange.cpp
Integer Constants
Variables in C++
Const Variables
Preprocessor Macros
Identifiers
Floating Point Numbers
Floating Point Data Types
Calculations
Integer Operations
Increment and Decrement
Precedence of Integer Operations
Floating Point Operations
op=
Mixed Data Types
Automatic Conversion
Cast
Math Library

Logical and Bit Operations
Bool Variables
Bool Operations and Truth Tables
Relational Operators
If Tests
Flow Chart
A Pitfall
Bitwise Operators
Bitwise Operator Truth Tables
Short Circuit Evaluation
Shifting
Masking

Loops and Structured Programming
Loops
While Loops
Infinite Loops
Flowcharting a While Loop
Indenting and Curly Braces
Accumulating a Total
Total Using a Sentinel
Counted Loops
Total Using a Counter
For Loops
Total Using a For Loop (Up)
Total Using a For Loop (Down)
Comparing For and While Loops
Variable Scope
Loops and If Tests Together
Nested If Statements
Review of Statements
Compound Statements
Structured Programming
Object-Oriented Programming

Functions and Program Structure
Basics of Functions
Function Prototypes and Type Checking
Returning Value
Argument Passing
Pass-by-Reference
Alternative to Pass-by-Reference
External Variables
Block Structure
Scope Rules
Header Files
Preprocessor Directives
Conditional Compilation
Recursion

Pointers and Arrays
Pointers and Addresses
Pointers and Function Arguments
Pointers and Arrays
Address Arithmetic
Dynamic Memory Management
Using malloc and free
Array of Pointers
Strings
String Functions
Array of Strings
Command Ling Arguments
Pointers to Functions

Structures and Unions
Fundamentals of Structures
Structure Declaration
Structures and Functions
Typedef
Arrays of Structures
Array of Structures Initialization
Unions

Concepts of Object-Oriented Programming
Object
State and Behavior
Abstraction
Encapsulation
Class and Instantiation
Abstract Data Types
Methods
Invoking Methods
Messages
Class Inheritance
Polymorphism
Classes in C++
Data Encapsulation in C
The C++ Class
Structures and Class in C++
Implementation of a C++ Class
this Pointer
Code Organization
Scope Resolution Operator
Abstract Data Types
Test Programs for C++ Classes

Functions in C++
Function Prototypes in C++
Strong Type Checking
Conversion of Parameters
Inline Functions
Inline Functions in Header Files
Default Arguments
Function Overloading
Argument Matching
Argument Matching through Promotion
Match through Type Conversion
Call by Value

Constructors and Destructors
The Problem of Initialization
Constructors and Initialization
Constructor in Stack Class
Object Creation and Destruction
Destructors
Multiple Constructors
String Class Implementation
Hidden Constructors
Using a Default Argument

Memory Management in C++
Why is Memory Management Important in C++?
Choices for an Object's Memory
Typical Memory Layout
Free Store Allocation
new Operator
Memory Allocation Errors
new vs. malloc
delete Operator
Destructor (Review)
Hiding Memory Management
String Class Specification (Version 2)
String Class Implementation
String Class Bug

References and Argument Passing in C++
Variables
Argument Passing
Call-by-Value
Reference Declarations
Call-by-Reference
Copy Constructor
Default Copy Constructor
Bug in String Class
Specification of String Class
Implementation of String Class
Test Program
Output of Test Program
Review of Constant Types
Constants and Arguments
Chains of Functions Calls
const Objects and Member Functions

Operator Overloading, Initialization, and Assignment
Operator Overloading
Operator Functions
Semantics of return
Returning a Temporary Object
Returning a Reference
Initialization vs. Assignment
Semantics of Assignment
Assignment
Assignment Bug
Overloading =
Review of this Pointer
Type Conversions
Conversion by Construction
Overloading Cast Operator
Test Program

Scope and Access Control
Scoping in C++
Block and Function Scope
File and Global Scope
Class Scope
Constant Types and Scope
Enumeration Types
Enumeration Types and Class Scope
:: for Global Data
Static Class Members
Initialization of Static Member
Static Function Class Members
Access Control
Friend Functions
Invoking Member and Friend Functions
Implementing a Friend Function
Efficiency and Friend Functions

Introduction to Inheritance
Inheritance Concept
Inheritance in C++
Employee Test Program
Protected Members
Best Class Initializer List
Composition
Member Initializer List
Order of Initialization
Inheritance vs. Composition

Polymorphism and Virtual Functions
A Case for Polymorphism
Dynamic Binding
Pointer Conversion in Inheritance
Polymorphism Using Dynamic Binding
Virtual Function Specification
Invoking Virtual Functions
Vtable
Virtual Destructors
Abstract Class Using Pure Virtual Function
Employee as an Abstract Class
Heterogeneous Collections
 

What makes this material hard to master

The syntax is rarely the hard part for someone who already programs. The harder shift is that C++ makes you decide where an object's memory lives and when it is cleaned up. The syllabus builds toward that in two stages.

Stage one: the procedural core. It starts with iostream input and output, then data types, signed and unsigned integers, two's complement, implicit conversion and casts. Bitwise operators, shifting and masking, loops, functions, pass-by-reference, the preprocessor and recursion follow. Pointers, address arithmetic, arrays, strings, malloc/free, pointers to functions, structures and unions come next. Pointers are usually the first real hurdle for people coming from languages that hide addresses.

Stage two: classes and their obligations. Each topic introduces a responsibility that the next one depends on:

  • Constructors and destructors raise the question of initialization and cleanup.
  • Free store allocation with new and delete raises ownership. The syllabus's String class goes through several versions and a bug, which shows how a hand-managed class goes wrong.
  • That bug leads to the copy constructor and to overloading =. Initialization and assignment are different operations, and confusing them is a classic error.
  • Operator overloading, returning a temporary versus a reference, const member functions, static members and friend functions then refine class design.
  • Inheritance, composition, virtual functions, the vtable, virtual destructors and abstract classes complete the picture.

Common misconceptions: that a C++ struct or class copies safely by default when it owns memory, that new and malloc are interchangeable, and that a base-class pointer deletes a derived object correctly without a virtual destructor. Each of these maps to a syllabus topic where the failure can be reproduced and examined.

Who it suits and what to take around it

The stated prerequisite is knowledge of a programming language, not C. The course suits developers from languages such as Visual Basic (the syllabus compares typing in Visual Basic) or other environments who need to read, write and maintain object-oriented C++. It runs five days and is rated general level. Because it teaches the C-style core alongside classes, it fits people who will also meet pointer-heavy existing code.

If you have little or no programming background, Introduction to C++ for Absolute Beginners is a shorter starting point that covers the basics before a full course like this one.

After this course, C++ Standard Template Library is a natural next step. You will have written your own String and stack classes by hand, so you are in a good position to see what standard containers and algorithms provide. For newer language features, Modern C++ Programming using C++11/C++14 builds on the class and memory model taught here.

Organizations whose codebases target a specific compiler or language standard can ask about customized private training through the training proposal request.

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.

  • Extending an existing domain model. For example, a team might inherit code with an Employee-style base class and several derived types held in one collection. The syllabus topics on inheritance, protected members, composition versus inheritance, virtual functions, pure virtual functions and heterogeneous collections explain how that design works. The virtual destructor material explains why deleting through a base pointer needs care.
  • Wrapping a resource in a class. A developer might need a class that owns a buffer or string and behaves correctly when passed to functions and assigned. Constructors, destructors, new/delete, the copy constructor, overloaded assignment and const member functions are the techniques involved.
  • Working with packed flags and status values. A team handling device or protocol data might use bitwise operators, shifting and masking, unsigned types, structures and unions to read and set individual fields. The syllabus covers these in its logical-and-bit-operations and structures sections.

AI coding assistants and this material

AI coding assistants can be useful here. They can explain what a compiler diagnostic means, describe what a pointer expression such as address arithmetic does, summarize an unfamiliar class hierarchy, and draft test programs for a class. That last use pairs well with the syllabus's habit of writing test programs for each class.

They fail most often on the topics that make this course hard. Generated code may allocate with new but release with free, omit a copy constructor or assignment operator for a class that owns memory, or skip a virtual destructor in a base class. It may also return a reference to a local object or mix C-style and C++-style memory handling. This code often compiles and passes a quick run, so the defect stays hidden.

To verify, turn on compiler warnings and treat them as errors, run the code under sanitizers such as ASan and UBSan, and write tests that copy, assign and destroy objects, including through base-class pointers. Review ownership by hand: for every allocation, name what releases it. Learn the rules first, because you need them to judge what an assistant produces.

Frequently asked questions

What level is this course, and who is it for?

It is a general-level, five-day introduction to object-oriented programming in C++ for developers who do not already know C. It starts with simple programs and moves through the C-style core to classes, memory management, operator overloading, inheritance and polymorphism.

What are the prerequisites?

Knowledge of a programming language. Prior C experience is not required, because the course covers data types, control flow, functions, pointers, arrays, strings, structures and unions before it introduces classes.

What does the course cover?

Two modules. The first covers iostream I/O, data types and operators, bit operations, loops, functions, pointers and arrays, and structures and unions. The second covers classes, constructors and destructors, memory management with new and delete, references and the copy constructor, operator overloading, scope and access control, inheritance, and virtual functions with abstract classes.

Can this be delivered privately for our team, onsite or online?

Yes. HSG delivers private training for organizations either onsite at the client's location or live online.

Can the content be customized?

Private courses can be tailored, including to the compiler or language versions your organization uses. Use the training proposal request to describe your environment and goals.

Training locations

C++ Programming for Non-C Programmers training across the U.S. and beyond.

We provide private C++ Programming for Non-C Programmers training for organizations, onsite at your location or live online, throughout the United States and internationally.

View all C++ Programming for Non-C Programmers 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
Request Group Training

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.