Overview
This week, I explored memory allocation, object-oriented programming (OOP), and the Standard Template Library (STL)โkey concepts for writing efficient, modular, and scalable programs. Here's a breakdown of what I covered:
Day 15: Memory Allocation & Static Members
๐น Key Topics:
- Dynamic vs. static memory allocation in classes.
- Using arrays within a class.
- Static data members for memory optimization.
๐ Practice Tasks:
โ
Shop Management System: Implement a class to store item data dynamically.
โ
Optimized Memory Usage: Modify the system using static members and methods.
Day 16: Arrays of Objects & Object Passing
๐น Key Topics:
- Managing multiple instances using arrays.
- Passing objects as function arguments.
๐ Practice Tasks:
โ
Employee Management System: Store multiple employees using an object array.
โ
Complex Number Operations: Perform arithmetic using object parameters.
Day 17-18: Friend Functions & Friend Classes
๐น Key Topics:
- Accessing private members using friend functions.
- Sharing data between classes via friend classes.
๐ Practice Tasks:
โ
Complex Number Addition: Implement a friend function to add two complex numbers.
โ
Swapping Private Data: Use a friend function to swap values between objects.
Day 19-20: Constructors, Destructors & Inheritance
๐น Key Topics:
- Default, parameterized, overloaded, and copy constructors.
- Destructor behavior and inheritance hierarchy.
๐ Practice Tasks:
โ
Bank Deposit Calculator: Use constructors for interest calculation.
โ
Single Inheritance: Implement an Employee
class inherited by Programmer
.
Day 21: STL & Advanced Concepts
๐น Key Topics:
- Sorting (Merge Sort), Binary Search.
- Vectors, Pairs, Tuples, Maps, and Sets.
๐ Practice Tasks:
โ
Sorting & Searching: Implement Merge Sort and Binary Search.
โ
STL Containers: Practice with Vectors, Maps, and Sets.
Reflections & Next Steps
This week strengthened my grasp on memory management, OOP principles, and STLโall essential for real-world applications. Next, Iโll focus on advanced STL operations and design patterns.
๐ฌ Whatโs your favorite STL feature? Drop your thoughts below! ๐