Labs for C++ advanced training
Lab | Solution | Topic | |
---|---|---|---|
Lab 01 | [lab] | [solution] | Data encapsulation |
Lab 02 | [lab] | [solution] | Class vs Structs |
Lab 03 | [lab] | [solution] | Getters and Setters |
Lab 04 | [lab] | [solution] | Default Constructor |
Lab 05 | [lab] | [solution] | Parameterized Constructor |
Lab 06 | [lab] | [solution] | Parameterized Constructor with default parameters |
Lab 07 | [lab] | [solution] | Shallow copy of an object using a the compiler-generated copy constructor |
Lab 08 | [lab] | [solution] | A shallow copy is not fine for all class members. |
Lab 09 | [lab] | [solution] | Passing an object to a function invoke constructor |
Lab 10 | [lab] | [solution] | Copy constructor to perform a deep copy of an object |
Lab 11 | [lab] | [solution] | Overload the assignment operator to create copies of objects in the Device class |
Lab 12 | [lab] | [solution] | Implement Client class |
Lab 13 | [lab] | [solution] | Define Template for class MathOperation |
Lab 14 | [lab] | [solution] | Multiple template parameter MathOperation Objects |
Lab 15 | [lab] | [solution] | Compare Calculator values using template function |
Lab 16 | [lab] | [solution] | Generic function compare() to compare types |
Lab 17 | [lab] | [solution] | A class as a template and default constructor |
Lab 18 | [lab] | [solution] | A class as a template and copy constructor |
Lab 19 | [lab] | [solution] | Friend class |
Lab 20 | [lab] | [solution] | Friend function |
Lab 21 | [lab] | [solution] | Global friend |
Lab 22 | [lab] | [solution] | Overload unary operator (+) |
Lab 23 | [lab] | [solution] | Overload binary operator (+) |
Lab 24 | [lab] | [solution] | Overload new and delete operators |
Lab 25 | [lab] | [solution] | Overloading the ostream operator << and >> |
Lab 26 | [lab] | [solution] | Overloading Subscript or array index operator [ ] |
Lab 27 | [lab] | [solution] | From containership to inheritance |
Lab 28 | [lab] | [solution] | Single Inheritance : Create a sub-class |
Lab 29 | [lab] | [solution] | Multiple Inheritance |
Lab 30 | [lab] | [solution] | Order of constructors call in multiple inheritance |
Lab 31 | [lab] | [solution] | Diamond problem : reference is ambiguous |
Lab 32 | [lab] | [solution] | Fix problems in code using access modifiers |
Lab 33 | [lab] | [solution] | Transform member function into virtual |
Lab 34 | [lab] | [solution] | Implement pure virtual function in derived classes |
Lab 35 | [lab] | [solution] | Polymorphism : Function overloading |
Lab 36 | [lab] | [solution] | C-Style cast |
Lab 37 | [lab] | [solution] | Use casting with static_cast to fix code |
Lab 38 | [lab] | [solution] | Understand use of dynamic_cast |
Lab | Solution | Topic | |
---|---|---|---|
Lab 01 | [lab] | [solution] | Library function exits |
Lab 02 | [lab] | [solution] | No possible values for integer error |
Lab 03 | [lab] | [solution] | Error code is not captured in cascade |
Lab 04 | [lab] | [solution] | Use errno to store error status |
Lab 05 | [lab] | [solution] | Throw an exception |
Lab 06 | [lab] | [solution] | Catch an exception |
Lab 07 | [lab] | [solution] | Uncaught exceptions |
Lab 08 | [lab] | [solution] | Catch all standard library exceptions |
Lab 09 | [lab] | [solution] | Catch all exceptions |
Lab 10 | [lab] | [solution] | Rethrow exceptions |
Lab 11 | [lab] | [solution] | Unwinding the stack in action |
Lab 12 | [lab] | [solution] | Multiple exceptions handling and hierarchy |
Lab 13 | [lab] | [solution] | Throwing exception on Destructor |
Lab 14 | [lab] | [solution] | Create a custom exception class |
Lab | Solution | Topic | |
---|---|---|---|
Lab 01 | [lab] | [solution] | string is a container |
Lab 02 | [lab] | [solution] | From a static array to a vector |
Lab 03 | [lab] | [solution] | Manipulate vector and deque |
Lab 04 | [lab] | [solution] | Manipulate a map |
Lab 05 | [lab] | [solution] | Manipulate a multimap |
Lab 06 | [lab] | [solution] | Operations on vector |
Lab 07 | [lab] | [solution] | Operations on maps |
Lab 08 | [lab] | [solution] | Non modifying Sequence Algorithms |
Lab 09 | [lab] | [solution] | Modifying Sequence Algorithms |
Lab 10 | [lab] | [solution] | Sorting and Searching Algorithms |
Lab 11 | [lab] | [solution] | Min and Max |
Lab 12 | [lab] | [solution] | Manipulating sequences |
Lab 13 | [lab] | [solution] | Manipulating iterators using operators |
Lab 14 | [lab] | [solution] | More iterators operations |
Lab | Solution | Topic | |
---|---|---|---|
Lab 01 | [lab] | [solution] | Using a Pointer to a Non Existing/Not Created Dynamic Variable |
Lab 02 | [lab] | [solution] | Using a Pointer to Deleted Dynamic Variable |
Lab 03 | [lab] | [solution] | Forgetting to Delete a Dynamic Variable |
Lab 04 | [lab] | [solution] | Overwriting a Valid Pointer to a Dynamic Variable |
Lab 05 | [lab] | [solution] | Deleting the Same Dynamic Variable again |
Lab 06 | [lab] | [solution] | Deleting Less Memory than Created |
Lab 07 | [lab] | [solution] | Deleting More Memory than Created |
Lab 08 | [lab] | [solution] | Variables Lifetime |
Lab 09 | [lab] | [solution] | RAII Class |
Lab 10 | [lab] | [solution] | Working with unique_ptr<> |
Lab 11 | [lab] | [solution] | Working with shared_ptr<> and weak_ptr<> |
Lab 12 | [lab] | [solution] | Solve Cyclic dependency problem using weak_ptr<> |
Lab 13 | [lab] | [solution] | Use weak_ptr<> as an observer |
Lab | Solution | Topic | |
---|---|---|---|
Lab 01 | [lab] | [solution] | Working with Lambda expressions |