



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
This lecture was delivered by Prof. Usman Younis at Quaid-i-Azam University. This lecture covers following points of course Object Oriented Programming using C plus plus: Object, Oriented, Programming, C plus plus, String, Class, Data, Types, Overloaded, Operators, Constructors, Variable
Typology: Slides
1 / 6
This page cannot be seen from the preview
Don't miss anything!




Usman Younis^ ^ ^ String objects can manage a dynamic memoryallocationOverloaded operators are available;Overloaded operators are available;^ ^ ^ ^ ^ char name[50]; OR char name[56];+ (add two strings), e.g., “this” + “ ” + “example”< (checks inequality), e.g., “this” < “yellow” (true)== (checks equality), e.g., “yellow” == “Yellow” (false)>= (checks inequality), e.g., “yellow” >= “Yellow” (true)
Usman Younis} cout<<"Length of s1: "<<s1.length()<<endl;cout<<"Size of s1: "<<s1.size()<<endl;cout<<s1.find(s3)<<endl;cout<<s1.compare(s2)<<endl;cout<<s1.compare(s3)<<endl;cout<<s3.compare(s2)<<endl;s = s3 + " " + s2;cout<<"s: "<<s<<endl;s.swap(s1);cout<<"After swapping...\n";cout<<"s: "<<s<<endl; ()^ ;