a doubt in programming in operator overloading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • puja
    New Member
    • Sep 2006
    • 1

    a doubt in programming in operator overloading

    creat a class string tht has data member:a pointer of character type.include constructors to intialize the string dynamically.inc lude member function to display the string content for the object.overload following operatord:

    1) == : for comparing two string operators
    2) += :shorthanding concatenation operator
    3) + :operator for concatenation

    write a main function ehere we r allowed to test the statements such as

    1) if (s1==s2)display strings r equal else strings r unequal
    2) s1+=s2;
    3) s3=s1+=s2;
    4)s3=s1+s2;

    whr the s1,s2,s3 are the objects of string class.
  • risby
    New Member
    • Sep 2006
    • 30

    #2
    Thank you for sharing your study question with us. How did you get on when attempting to answer it?

    Comment

    Working...