C++ Programming for C Programmers
Duration: 5 Days
Description
This hands-on course is a comprehensive introduction to object-oriented programming in C++, built specifically for programmers who already know C. Across 16 modules, you’ll learn the C++ features that support clean modeling of the problem domain and effective code reuse, backed by extensive programming examples and exercises. The course runs in any environment with an ANSI C++ compiler, so you can apply what you learn immediately in your own codebase.
Audience
Designed for experienced C programmers ready to expand into C++ and object-oriented programming. Ideal for developers who want to leverage classes, inheritance, polymorphism, templates, and exception handling to build more robust, maintainable software. You should already be comfortable with procedural programming, C syntax, and memory management — this course focuses squarely on the leap from C idioms to modern C++ design.
Objectives
- Learn object-oriented concepts
- Acquire a thorough working knowledge of C++ programming
- Gain an understanding of the issues involved in effective class design
- Learn how to program with templates and become introduced to STL
- Become introduced to newer features of C++, including the ANSI standard library, exception handling, and RTTI
Prerequisites
This course assumes a good knowledge of C programming. Students without a strong background in C should consider instead the course C++ Programming for Non-C Programmers.
Course Outline
Module 1: Concepts of Object-Oriented Programming
- Objects
- Information Hiding and Encapsulation
- Abstract Data Types
- Methods and Messages
- Classes
- Class Inheritance
- Polymorphism
Module 2: Classes in C++
- Data Encapsulation in C and C++
- Definition of C++ Classes
- Member Data and Functions
- this Pointer
- Abstract Data Types
- Organizing Code for Classes
Module 3: Functions in C++
- Function Prototypes and Type Checking
- Conversion of Parameters
- Default Arguments
- Inline Functions Function Overloading
Module 4: Constructors and Destructors
- Constructors and Initializations
- Object Creation and Destruction
- Destructors
- Multiple Constructors in a Class
- Hidden Constructors
Module 5: Memory Management in C++
- Static, Automatic, and Heap Memory
- New and Delete
- Handling Memory Allocation Errors
- Hiding Details of Memory Management in a Class
- Implementing a Dynamic String Class
Module 6: References and Argument Passing in C++
- Call by Value
- Reference Declarations
- Reference Arguments
- Copy Constructor
- Constant Arguments and Functions
Module 7: Operator Overloading, Initialization, and Assignment
- Operator Overloading
- Semantics of Assignment
- Initialization vs. Assignment
- Overloading Assignment
- Type Conversions
Module 8: Scope and Access Control
- Scope in C++
- Friend Functions
- Const and Enumeration Types
- Static Members
Module 9: Introduction to Inheritance
- Inheritance for Modeling and Reuse
- Class Derivation
- Access Control
- Base Class Initialization
- Composition
- Initializing Class Type Members
Module 10: Polymorphism and Virtual Functions
- Virtual Functions and Dynamic Binding
- Polymorphism in C++
- Pointer Conversion
- Virtual Destructors
- Abstract Classes and Pure Virtual Functions
Module 11: ANSI C++ Library
- New Header Files
- Namespaces in the Standard Library
- ANSI C++ String Classes
- Templates in the Standard Library
Module 12: Templates
- C++ Template Mechanism
- Function Templates
- Class Templates
- Generic Programming
- Implementing a General Array Class
- Standard Template Library
Module 13: Input/Output in C++
- Streams I/O Library
- Formatted Stream I/O
- File I/O
- I/O in User Defined Classes
Module 14: Practical Aspects of C++ Programming
- Interfacing C and C++
- Namespaces
- Reliability in C++ Programs
- Testing Considerations
- Efficiency Considerations
Module 15: Exceptions
- C++ Exception Mechanism
- Exceptions Compared to Other Error Handling Techniques
- throw, try, and catch
- Exception Context and Stack Unwinding
- Uncaught Exceptions
- Automatic Cleanup in Exception Handling
Module 16: Runtime Type Information
- Runtime Type Information (RTTI) Mechanism
- type_info Class and typeid Operator
- Type Safe Pointer Conversion
- New C++ Cast Syntax