Skip to content

About operator overloading !!!!#14

Open
Butcher3Years wants to merge 1 commit intoImplicit-conversion----Explicit-Keywordfrom
Operator--Its-overloading
Open

About operator overloading !!!!#14
Butcher3Years wants to merge 1 commit intoImplicit-conversion----Explicit-Keywordfrom
Operator--Its-overloading

Conversation

@Butcher3Years
Copy link
Copy Markdown
Owner

My C++ Slaughterhouse Journey 🪓🔥

Hey, I'm Suhas — a beginner from Bihar grinding through The Cherno's C++ series like it's a boss fight.
This repo is my live battlefield: raw code, mistakes, fixes, and "aha" moments as I go from basics to building real stuff.

What I'm Learning Right Now

  • Operator Overloading — turning ugly .Add() and .Multiply() into clean + and *
  • Vector2 math (position + speed * powerup = new position)
  • Making custom types feel like built-in ones (==, !=, << for printing)
  • No Java-style .equals() nonsense — real C++ operators!

Key Branches (Topics Covered So Far)

Branch What I Built / Learned Status
main Starting point, includes, basic structs Active
arrays Arrays vs pointers, decay, fixed-size pain Done
std-string std::string vs char*, literals, find(), npos Done
constructors Member initializer lists, explicit, conversions Done
operator-overloading + - * == != << for Vector2 (current grind!) In Progress
inheritance Coming soon... base/derived, virtual Planned

Current Focus: Operator Overloading

From this:

result = position.Add(speed.Multiply(powerup));


result = position + speed * powerup;   // BODMAS works!
std::cout << result << std::endl;      // prints "4.5, 5.5"
if (result1 == result2) { ... }        // natural equality





and when to use them!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant