


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The creation of a custom string class named mystring. The class includes a char* and an integer size, and overloads various operators such as '>>', '<<', '+', '=', '-', '!', '!=', '==', ',', '&', '++', and '--'. The document also discusses the implementation of functions for constructors, destructors, and variable counting. Intended for university students studying c++ programming.
Typology: Exercises
1 / 4
This page cannot be seen from the preview
Don't miss anything!
the size of string from user & than Enter the string from the user.
Overload the following operator for the class Mystring:
“>>”: take the input of object of Mystring, i.e. 1st^ string size & than string
Main() { Mystring obj; Cin>>obj; }
Main() {
Eneter the Size of String: 25 Enter String: Mid-Exam was so easy
Your output is: The Size of String Allocated: 25 The Original Size of String: 20 String: Mid-Exam was so easy
Mystring obj; Cout<<obj; }
Example: 1st^ object have“Table” & 2nd^ object have “chair” when obj1+obj Than output on screen should be: Table & Chair
Example: 1st^ object have “Table” & 2nd object have “chair” when obj1=obj Than output on screen should be: chair
Example: 1st^ object have “FAMES” & 2nd object have “NAMED” when obj1-obj Than output on screen should be: FNSD
Example: 1st^ object have “table” than “!obj1” output will be: ELBAT
Example: 1st^ object have “FAMES” & 2nd^ object have “NAMED” when obj1!=obj Than output on screen should be: objects are not equal
Note: Ø Make all the necessary functions including constructor & destructor. File should be submitted. i.e., “rollno_A5”.delete Debug folder. Only zip Ø All code files should contain Roll Number, Name, Assignment Number and Date, e.g.:// Syed Mohammad Irteza // 07-0555// assignment Ø // 10/06/2009Your code should have appropriate comments. Ø Ø Use meaningful identifier names for variables and functions.Properly indent your code, to make it readable.