My problem isn't really with C++ but rather with my professor, he recently handed out our latest assignment and no one in my class even knows where to begin... Since i can't find anyone who can help me in the slightest, asking the professor gets me nowheres fast... i thought i'd post the question and see if anyone can help us get started...
Problem:
In order to manipulate complex arrays you need to define two classes,
namely, Complex and CArray. The Complex class shoud have a conversion
constructor to convert one or two doubles to a complex, and a copy
constructor. It should have c_abs(c) friend function to calculate the
absolute value of the Complex c.It should also overload the =, +, -,
*, /, <<, and >> operators. Similarly, it should overload these
operators as well as % (inner product), ^ (cross product), ==, !=,
and [] operators. The CArray class should have copy and conversion constructors: from one or two doubles to Carray; from Complex to CArray.
What the hell does this all mean?
I've started writing both the class's but i'm having trouble overloading operators in class Complex, and also with the conversion constructors of both classes
Any Advice is greatly appreciated.
Problem:
In order to manipulate complex arrays you need to define two classes,
namely, Complex and CArray. The Complex class shoud have a conversion
constructor to convert one or two doubles to a complex, and a copy
constructor. It should have c_abs(c) friend function to calculate the
absolute value of the Complex c.It should also overload the =, +, -,
*, /, <<, and >> operators. Similarly, it should overload these
operators as well as % (inner product), ^ (cross product), ==, !=,
and [] operators. The CArray class should have copy and conversion constructors: from one or two doubles to Carray; from Complex to CArray.
What the hell does this all mean?
I've started writing both the class's but i'm having trouble overloading operators in class Complex, and also with the conversion constructors of both classes
Any Advice is greatly appreciated.