DEV Community

Adhyan Jain
Adhyan Jain

Posted on

๐Ÿš€ Week 11: Mastering Operator Overloading, Templates & STL in C++

Apologies for the delay in posting thisโ€”exams kept me busy. Finally catching up!

This will be the last post of my C++ learning progress. Stay tuned for the next topic I'll pick!

This week, I delved deep into operator overloading, inheritance, virtual functions, templates, and STL containers in C++. Here's a quick recap of what I worked on during Days 104โ€“110.


๐Ÿ”น Day 71 โ€“ Operator Overloading

  1. Time Incrementer โ€“ Overloaded ++ to adjust departure time
  2. Matrix Math โ€“ Multiplication and transpose operations
  3. Matrix Negator โ€“ Unary - to invert matrix elements

๐Ÿ”น Day 72 โ€“ Inheritance & Virtual Functions

  1. Population Growth Calculator โ€“ Virtual calcRate()
  2. Time Format Converter โ€“ Conversion between hours, minutes, and seconds
  3. Reservation Discount System โ€“ Age-based pricing

๐Ÿ”น Day 73 โ€“ Abstract Classes & Use Cases

  1. Meal Price Estimator โ€“ Polymorphism with calculatePrice()
  2. Shop Inventory Manager โ€“ Item management using virtual functions
  3. Experiment Analyzer โ€“ Analyzing experimental data with polymorphism

๐Ÿ”น Day 74 โ€“ Practical Polymorphism

  1. Item Cost Calculator โ€“ Discounts based on item type
  2. Banking System โ€“ Inheritance for different account types
  3. Vehicle Cost Tracker โ€“ Calculate travel time/cost across modes

๐Ÿ”น Day 75 โ€“ Templates

  1. Stack Handler โ€“ Operations for int and float types
  2. URL Tracker โ€“ Indexing URLs with function templates
  3. Laptop Model Manager โ€“ Track models using function templates

๐Ÿ”น Day 76 โ€“ Smart Array Operations

  1. Composite Number Filter โ€“ Remove primes from list
  2. Array Max Finder โ€“ Find largest/second-largest elements
  3. Odd Index Printer โ€“ Print elements at odd indices

๐Ÿ”น Day 77 โ€“ STL & Template Utility Apps

  1. Construction Inventory System โ€“ Update/display material info
  2. STL List Handler โ€“ Sort/remove duplicates from std::list
  3. Table Generator โ€“ Print multiplication table for an array element

๐Ÿ Key Takeaways

โœ”๏ธ Focused on operator overloading, templates, and polymorphism

โœ”๏ธ Built real-world applications with inheritance and STL

โœ”๏ธ Gained hands-on experience in generic programming using templates

Top comments (0)