18STROVL - } int str :: operattor<(str s2) {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> #include<string.h> # class str { char s[25]; int i; public: void get() { cin>>s; l=strlen(s); } void display() { cout<<s<<endl; } str operator+(str); int operator<(str); }; } str str :: operator+(str s1) { str t: strcpy(t.s,s); strcat(t.s," "); strcat(t.s,s1.s); return t;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } int str :: operattor<(str s2) { if(l<s2.l) return 1; else return 0; } void main() { clrscr(); str s11,s22,s33; s11.get(); s22.get(); s33=s11+s22; s13.display(); if(s11<s22) cout<<"First Shorter"; else cout<<"Second Shorter"; getch(); }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM1 taught by Professor Thakur during the Fall '06 term at University of Mumbai.

Ask a homework question - tutors are online