Launcher

Type to filter results. Use arrow keys to navigate, Enter to select.

Preferences

You've reached the end of the results

Project Overview

A from-scratch implementation of a complex number class in C++, covering construction, copy/move assignment, equality, and arithmetic — addition, subtraction, and multiplication — through operator overloading.

Source Code Repository

Technical Details

  • Implemented as a standalone ComplexNumber class (complex_number.hpp / complex_number.cpp) with no external dependencies.
  • Overloads +, -, *, ==, and stream insertion/extraction (<< / >>), plus a to_string() helper for formatted output.
  • Every constructor, destructor, and assignment prints a trace line, making it a handy way to observe C++ object lifetime while stepping through main.cpp.
  • Compiled directly with g++: g++ -o build/demo main.cpp complex_number.hpp complex_number.cpp.

References