Frequently Asked Questions

This page will be updated as questions are raised.

Q) Will assignments be distributed in class?

A) No. All assignments will be placed on the web site, where they can be retrieved.

Q) Operator Overlaoded
I have declared the "friend" function into my component class (e.g. CPU), such as the below:
class computer;

class CPU
{
friend computer& operator+= (const computer&);

public: ...

private: ...
}


But it gives me this error:

d:\concordia\2nd semester\comp5421\assignment2\sourcecode_part2\cpu.h(13) :
error C2805: binary 'operator +=' has too few parameters
computer.cpp
d:\concordia\2nd semester\comp5421\assignment2\sourcecode_part2\cpu.h(13) :
error C2805: binary 'operator +=' has too few parameters
Error executing cl.exe.

A)
If you declare/define the overloaded operator inside the class, then you need only one (Computer) parameter since the left-hand one will be the current object. Since you declared/defined the operator outside the class (similar to a free function), the operator needs two (Computer) parameters. That is why this error is returned.
In short, you will need to have two parameters since the overloaded operator is not a member of the class.

Q) How can I subscribe to the mailing list?

A)
Go to: https://mail.encs.concordia.ca:444/
Click on Comp 5421 link, such as Comp5421-s05, and follow the registration process.
Note: Do not use important passwords there, such as your bank account's PIN.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

©2001-2005 E-ComFever Inc.