&&& BIG Problem In Operator Overloading &&&

Hello Everybody
I Have A Question .

Suppose That We Have This Class :

/////////////////////////////////////////////////////////////////////////////
class StringClass
{
public:
...
void someProcessing( );
...
StringClass& operator=(const StringClass& rtSide);
...
private:
char *a;//Dynamic array for characters in the string
int capacity;//size of dynamic array a
int length;//Number of characters in a
};


/////////////////////////////////////////////////////////////////////////////

In Line That I Overload "=" , Why We Use " & " In Two Place :
1 - After Return Type Of Function ( After StringClass ).
2 - In Argument Of Function .

Please Help Me .
Hi Firedraco
Somthing that you tell me is not usefull. I Want Someone Scientificly Answer To My Question .
Tnx
Scientific research has concluded that to answer that question one must read the tutorial that firedraco posted.
(I am a professional scientist professor doctor)


PS.
Stop Capitalizing The First Character Of Every Word You Type
Scientific Research Has Concluded It Is Incredibly Annoying
Last edited on
In that post that firedarco said , there is not answer of my first question.
pls help me.
Yes, the answer is there, the first paragraph explains exactly what an " & " is used for.
Last edited on
closed account (z05DSL3A)
In Line That I Overload "=" , Why We Use " & " In Two Place :
1 - After Return Type Of Function ( After StringClass )

A reference is returned by the assignment operator. This is to allow operator chaining.
Last edited on
Very thanks Grey Wolf for your good answer , but I have another question :
Why When we want operator chaining , we use from reference ?
closed account (z05DSL3A)
The following should be of help:
http://www.parashift.com/c++-faq-lite/references.html

I have question in that link that Grey Wolf said in above topic :
Which feature of reference operator (&) enable us to use from that to make operator chaining ?
Topic archived. No new replies allowed.