Skip to content
Snippets Groups Projects
public
Authored by avatar Marc Bärtschi @marc

asd

Embed
Share
  • Clone with SSH
  • Clone with HTTPS
  • asd.cpp 746 B
    #ifndef COMPLEX_H
    #define COMPLEX_H
    
    #include <iostream>
    using namespace std;
    
    struct Complex
    {
        double real;
        double imaginary;
    
        Complex();
        Complex(double r, double i);
        Complex(const Complex &other);
        Complex operator=(Complex newVal);
    };
    
    std::ostream &operator<<(std::ostream &out, const Complex &c);
    std::istream &operator>>(std::istream &in, Complex &c1);
    
    Complex operator+(Complex c1, Complex c2);
    Complex operator-(Complex c1, Complex c2);
    Complex operator-(Complex input);
    Complex operator*(Complex c1, Complex c2);
    Complex operator/(Complex c1, Complex c2);
    bool operator==(Complex c1, Complex c2);
    bool operator!=(Complex c1, Complex c2);
    
    // Write structure declaration/operators forward declarations here
    
    #endif
    0% or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment