
Explore object-oriented programming in C++20 with a practical, module-based approach that covers classes, objects, constructors, destructors, inheritance, polymorphism, virtual functions, namespaces, and code reuse.
Install Visual Studio Community 2022 on Windows, choose desktop development with C++, and, if desired, enable Unreal Engine game development options for C++ projects.
Set up a Visual Studio C++20 project from scratch, create an empty project, organize code with folders, configure output and intermediate directories, and build a hello world to verify setup.
Explore how object oriented programming uses classes as blueprints to create reusable objects and instances that model real world entities.
Learn to access class members in C++20 by using dot and arrow operators. Practice managing member variables and functions with pointers, including unique and shared pointers, while applying public access.
Explore how encapsulation organizes class data, hides private members, and exposes only public interfaces to control access and ensure data integrity in C++20.
Explore how a struct in C++20 groups related variables like a class, but with public by default, making it ideal for lightweight, small data structures.
Master declaring prototypes inside a class and implementing them outside with the scope resolution operator to keep the class body clean and access private members.
Constructors build a class object and initialize its members, supporting multiple parameter forms, including default. Destructors deallocate memory and clean up as objects go out of scope.
Explore how default constructors behave in c++20, when the compiler supplies one automatically, and how to declare a default constructor alongside parameterized constructors for default initialization.
Overloading constructors in C++20 lets you create objects in multiple ways with different parameter lists. It uses default and parameterized constructors to initialize name and age.
Learn how constructor initialization lists initialize member variables in C++20, using a colon to set values. Apply default and two parameter constructors to initialize name and age efficiently.
Learn how constructor delegates enable a class to delegate initialization to another constructor, reducing duplicated code and centralizing setup in a single constructor.
Discover how constructor default parameters streamline object initialization in C++20, replacing multiple constructors with a single parameterized constructor using default parameter values and initialization lists.
Apply the explicit keyword to constructors to disable implicit conversions, preventing temporary objects during comparisons and avoiding surprises when comparing a cube with a raw integer such as 13.
Learn how a copy constructor creates a new object by copying another, explore shallow copy and deep copy, and understand compiler-generated copies and when to delete or implement your own.
Explores shallow copy in C++20 by showing how copying an object duplicates its members, and why copying pointers with dynamic memory can cause dangling pointers and undefined behavior.
Deep copy creates independent copies by dynamically allocating memory for each pointer. It copies values into new memory, avoiding shallow copy and enabling copy constructors for raw pointers.
Move constructors transfer ownership of resources instead of copying, boosting efficiency for large objects. Learn how to implement, use, and delete copy constructors, and apply std::move.
Understand the this pointer in object oriented programming with C++20: access object members with this->, resolve name conflicts, and enable method chaining by returning the object using dot or arrow.
Explore const with classes in C++20, mastering const objects, const member functions, const correctness, and the mutable keyword to allow changes inside const contexts.
Static class members belong to the class itself, are shared by all objects and accessed without creating an instance via the class scope resolution operator.
Understand how friend classes grant access to private and protected members in C++20, and learn about declaration scope, mutual friendship, and non-transitivity.
Explore why private class members enable data hiding and encapsulation, and how getters and setters (accessors and mutators) control access and modification of those variables.
Discover nested classes in C++20 by defining an inner class inside an outer class. See how the inner class accesses outer private members and how to instantiate objects using scope.
Build a library system in C++20 that manages books and members, offering display, add, borrow, return, and exit through a menu-driven interface.
Build a C++20 object-oriented library system with book and member classes and a library container. Implement getters, constructors, vectors, and functions to add, display, borrow, and return books.
Explore C++20 modules, a faster, encapsulated alternative to header files. Learn module interface and implementation units, plus import and export syntax to organize large codebases and improve build times.
Learn how to separate module interface units from module implementation units in C++20, using prototypes at the top, and improve encapsulation, organization, and build efficiency.
Explore exporting import modules in c++20, focusing on reachability and visibility across modules. See how the export keyword, interface units, and exporting imported modules reveal and expose functions and variables.
Explore module partitions to divide a large module into partitions like B of A, importable only through A. Control visibility with export and non-export, supporting scalable C++20 code organization.
Explore global module fragments in C++20, compare modules with headers, and learn to include legacy C headers like C math and iostream, using include and import in modules.
Organize a large unstructured C++20 OOP program into library modules, separating book, member, and menu, to enable borrow and return functionality and improve debugging and maintenance.
Discover how organizing C++20 code into modules for library, book, member, and borrow and return components simplifies navigation, debugging, and extension by isolating concerns.
Understand what a namespace is and why it prevents naming conflicts. Learn to create and use namespaces, like math and science, and call their functions with the scope resolution operator.
Discover how nested namespaces work in C++20 by defining a namespace inside another. Access inner members by qualifying with outer then inner namespaces, as shown with math and science examples.
Explore how namespaces and modules work together to organize code, export multiple namespaces from a module, and access nested namespaces via scope resolution in C++20.
Overload the insertion and extraction operators to enable custom printing and input of C++ objects via streams like std::cout. Use friend functions to access private members.
Explore the limitations of operator overloading in C++20, including which operators can be overloaded, which must be members, and how explicit constructors prevent unwanted conversions.
Overload the spaceship operator in C++20 to automatically support all relational operators through lexicographical comparison, using auto return and a const reference.
Learn to build function objects, or functors, in C++20 by overloading the function call operator so class instances behave like functions and accept multiple parameters.
Explore type conversion in c++20 by defining custom implicit and explicit conversion operators as class members that convert a box to double by returning its volume.
Investigate operator overloading in C++20, covering arithmetic and comparison operators, insertion, and safety checks, with downloadable code and practical gaming and banking examples.
Inheritance lets a class reuse code by deriving from a superclass, creating a parent-child hierarchy, enabling derived classes to extend properties, behaviors, and polymorphism.
Apply the is-a test to decide if a class should be a derived version of another base class; if not, use a has-a relationship with objects.
Explore protected class members in C++20, showing protected access that lets derived classes use base members while hiding them from code, and how public, protected, and private inheritance shapes visibility.
This lecture explains constructors and destructors in inheritance: base class constructors run before derived, destructors reverse; constructors are not inherited, but you can use using to inherit.
Explore how base class constructors and parameterized constructors interact with derived classes. Learn how to delegate to base constructors or delete default constructors to ensure object creation from derived classes.
Explore how copy and move constructors involve the base class when creating derived objects, using base and derived initialization. Understand copy, move, and assignment operators, destruction order: derived before base.
Explore how overriding lets a derived class provide the same-named, same-parameter, same-return-type method as the base, and how calls resolve to the appropriate version.
Explore how duplicated names in base and derived classes are resolved, how function hiding differs from overloading across scopes, and how a using declaration exposes base class functions.
Explore multiple inheritance in C++20, enabling a class to inherit from several base classes. Using ship, ship 2D, and color, square combines their functions and data, illustrating calling base-class methods.
Explore repeated inheritance and the diamond problem in C++20, and learn how virtual base classes prevent multiple copies of a base like human, ensuring a single object in manager.
Learn inheritance in C++20 by modeling a vehicle base class and derived car, bicycle, and electric car with start engine, drive, and display methods.
Explore object-oriented programming in c++20 with a vehicle hierarchy, including car, bicycle, and electric car, highlighting virtual drive, polymorphism, display functions, and constructors.
Explore polymorphism in C++20, including compile-time and runtime forms, via function and operator overloading, and virtual and override keywords for proper function overriding.
Learn how virtual functions enable runtime polymorphism by overriding base class behavior in derived classes, using pointers or references, and how virtual destructors ensure proper cleanup.
Explore how virtual functions enable polymorphism and incur memory, runtime, and time costs through the vtable, as base and derived classes share and override entries.
Learn how the final specifier prevents inheritance and method overriding in C++20, with examples of final classes and final methods and their syntax.
Learn how default arguments interact with virtual functions in C++20, revealing compile-time resolution that can override derived defaults, and why avoiding defaults with virtuals is recommended.
Abstract classes are blueprints with at least one pure virtual function (virtual ... = 0); they cannot be instantiated and require derived classes to implement all pure virtual functions.
Explore polymorphic collections in c++20 by storing derived objects in vectors or arrays via base-class pointers, enabling dynamic dispatch with virtual draw and safe memory using smart pointers.
Explore static_cast in c++20 for explicit, compile-time type conversions, including downcasting from derived to base and upcasting base pointers to derived objects, with safety through explicit casts.
Learn how dynamic_cast enables safe down casting at runtime for polymorphic classes, allowing access to non-virtual functions via base class pointers with null-pointer checks.
Learn object-oriented programming in c++20 by building a bank app with bank and saving accounts, deposits, withdrawals, and transaction history using a vector of strings.
Explore object-oriented programming in C++20 with a bank account simulation, highlighting polymorphism, base and derived classes, virtual functions, pointers, and transaction history.
Are you ready to unlock the full potential of C++ and revolutionize your programming skills? This comprehensive course is designed to take you to a proficient C++ programmer, focusing specifically on Object-Oriented Programming (OOP) principles using the latest features of C++20.
Throughout this course, you will delve deep into the fundamental concepts of OOP and learn how to leverage them effectively in your C++ projects. Here's a glimpse of what you'll cover:
Classes and Objects: Understand the building blocks of OOP, including classes, objects, and their interactions.
Encapsulation: Discover the power of encapsulation in C++ to hide implementation details and protect data integrity.
Constructors and Destructors: Master the creation and destruction of objects with constructors and destructors, including overloading constructors for flexible object initialization.
Copy and Move Semantics: Dive into the concepts of shallow and deep copy, move constructors, and their importance in resource management.
This Pointer and Friend Classes: Learn how to access class members and grant special access privileges to external classes.
Setters and Getters: Implement encapsulated access to class data using setter and getter methods.
Nested Classes: Explore the concept of nested classes and their role in organizing and encapsulating complex data structures.
Modules: Harness the power of C++20 modules for efficient code organization, exportation, and importation.
Namespaces and Relationships: Understand the relationship between namespaces, modules, and classes for better code organization and modularity.
Operator Overloading: Extend the functionality of operators for user-defined types to enhance code readability and expressiveness.
Inheritance and Polymorphism: Delve into advanced OOP concepts like inheritance, polymorphism, and dynamic binding, including virtual functions, VTables, and the final specifier.
Multiple Inheritance: Navigate the complexities of multiple and repeated inheritance to build robust class hierarchies.
Each section of the course is accompanied by practical examples and hands-on exercises, allowing you to reinforce your learning and gain practical experience. By the end of this course, you'll have the confidence and skills to tackle complex C++ projects with ease, leveraging the full power of Object-Oriented Programming.
Enroll now and embark on a journey to become a master C++ developer!