好库网首页 | 我的好库
好库网 好库网社区
IT社区 » C/C++ » C++论坛 » C++ problem???
回复 发帖

查看:26    回复:0 C++ problem???
访问spadekevin的空间
发表于 2018/6/25 22:27:08
1楼

Hi,

 

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 a slightest, Asking the professor gets me nowheres fast... i thought i'd post the question and see if anyone can us help started...Problem:

In order to manipulate complex arrays you need to define two classes, that is
, 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 overload the =, +, -,
*, /, <<, and >> operators. similar, 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 help will be apprecited.

 

I didn't find the right solution from the Internet.

 

References:

Https://arstechnica.com/civis/viewtopic.php?t=918909

Web Based Marketing Example

 

Thank you.

 

 

 

 

 

 

 

 

 

 

您需要登录后才可以回帖 登录 | 注册
回复 发帖