In article <1993Jan22.075317.21062@usl.edu>, rks9954@usl.edu (Srinivasa Rao K) writes:
|>
|>
|>
|>
|> Hi C++ masters,
|>
|> I have small question ...
|>
|> I am writing a "string" class which i should be able
|> to use like
|>
|>
|> string str1;
|>
|> str1 = "Hello world" ;
|>
|>
|>
|> But We canot use a friend to overload the assignment oprator.
Why should you want to use a friend to redefine the assignment operator? If you are designing a class you can also include a definition for the `=` operator to give it the semantics you want. See 13.4 ARM.
|>
|> So finally I had to convince myself to use something like
|>
|>
|> str1 <= "Hello world"
|>
|>
|> which works.
|>
|> Is there any way to do the first method ....
|>
|>
|> Thanks for those who spend time reading this ....