Ian Collins wrote:
Quote:
Ashwin wrote:
Quote:
thanks for the reponse can anyone tell me how to implement the
following eqation
s[1]='a';
where s is a object of the string class i have written
plzz tell me how to overload the operations just signatures of the
functions.
Show us what you have so far.
>
Please stop using silly abbreviations like 'plz' and try to use correct
capitalisation. Otherwise your posts are hard to read an people who
might help you will ignore them.
>
>
--
Ian Collins.
sorry Ian collins i wont use that abbrevation again . i have overloaded
both [ ] and = operator as follows
void operator=(char *s);
void operator=(string1 s);
and
string1& operator+(char *s);
char operator[](unsigned int i);
where string1 is the string class i am writing.
so to implement the expression s[1]='c';
i donot know how to overload the operators
i am thinking of using char operator=(char ch);
and char operator[ ] (unsigned int i);
i don't know whether it will work or not have to try.